2 Comments
User's avatar
Matteo Vaccari's avatar

Hi Nik, a bigger problem I see with this fragment of code is that it seems to encode a procedure in its name: doThisThenThisAndThat(). I find it better when we are able to encode the procedure in actual code. For example:

SummaryAdapter.requestSummariesAndCalculateAviosEarn(searchCriteria, it)

trips := allTrips().with(startDate, duration).withHotelCode(hc).withParticipants(2, 0, 0).find().summaries().withAvioPoints().calculate()

Expand full comment
Nik's avatar

Hi, Matteo.

If I understood you proposal correct: will be better ti change boilerplate logic to criteria queriy style. And, incapsulate business logic into domain.

So, agree, this style is more redable.

On other hand, that refactoring will take more time and I will reccommend to make it as the separated task.

My proposal you can implement on the fly. When you introduce other changes in the code.

It a light weit version I think :D

Expand full comment