The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Ilja Tollu (12) [Avatar] Offline
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 (116) [Avatar] Offline
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 ..