I'm not familiar with Java API but my impression is that AllDirectives is a 
device for bringing all pre-defined directives in scope of your Route 
producing functions.
Routes themselves are values and you can combine them to produce more 
complex routes. For example you could have several classes extending 
AllDirectives containing methods that produce Route values.
Such methods could take other Routes as parameters, to support nesting and 
references to "services" needed to implement route's functionality 
(ActorRefs and so on).
Then you could have a function that constructs all the partial routes and 
wires them together to produce the root route of your application.

Hope that helps,
Rafał

W dniu środa, 5 października 2016 18:11:17 UTC+2 użytkownik 
jpste...@skydance.com napisał:
>
> Now that i'm finally getting the hang of creating routes for akka http i'm 
> discovering that I need a good way to organize everything. What is the 
> recommended way to organize custom directives for routes into different 
> files (specifically in Java)?
>
> Ideally i'd like to be able to define custom directives that handle 
> processing of my REST API in an increasingly more complex fashion. So the 
> primary route will capture large buckets of url's based on a sub-system and 
> then hand off the additional work to other directives defined in other 
> classes for further processing. However from what I can tell this isn't 
> possible, is it?
>
> If I put everything in one file I am afraid it's going to get crazy out of 
> hand with thousands of lines of code and possibly hundreds (ouch!) of 
> directives and the class structure of AllDirectives is a little unnerving 
> since it's one massive chain of single inheritance. That means i'd have to 
> constantly be refactoring my chain of inheritance in order to add new 
> systems to the API (more ouch!).
>
> How does everyone handle this organization?
>
> Jean-Philippe
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to