Ilja Tollu (9) [Avatar] Offline
#1
Thank You for great book!
As I am trying to implement this knowledge in REST-service, I feel myself a little bit messed about modularization.
One question is: where should I put Protocols (traits) and their implementations (traits with companion objects)? Should it be considered a service or some other part of domain? Then, if I get it correctly, I should import some protocol interpreter without protocol trait itself, right?

Best regards!
Ilja Tollu
Debasish Ghosh (113) [Avatar] Offline
#2
As I discuss in the chapter on modularization, there are many ways to go about modularizing your code. Yes, with Scala, traits and objects are the primary techniques for modules. One strategy you can adopt is to have packages based on domain functionality at a higher level and then have traits within them. Design traits with an eye towards compositionality. And defer creation of objects from the composed traits till the last.

Does that answer your question ? Feel free to get back if u need more details ..

Thanks.