3 ms·
It may be slightly more verbose but you have to consider that the Java variant contains much more information in a single location. For example having a single
by mbell 15y ago
It may be slightly more verbose but you have to consider that the Java variant contains much more information in a single location. For example having a single file with methods annotated with @GET or @POST is so much cleaner to me than having routes.rb open in another editor window constantly Ctrl-Fing through it to sort out whats going on.
- hello_moto 15y agoI think that's a matter of preference. I don't mind both styles (after working with Spring MVC 3, Servlet 3, JAX-RS, and Rails)
- masklinn 15y ago> For example having a single file with methods annotated with @GET or @POST is so much cleaner to me than having routes.rb open in another editor window URL mapping is a framework detail, not a language detail — although the framework can be limited by the language. In Sinatra you'd write: get 'someroute' do # do stuff end http://www.sinatrarb.com/intro.html#Routes http://www.sinatrarb.com/intro.html#Routes each style (these and half a dozen others) has its advantages and inconvenients. For instance, separate urls mapping (Rails, Django) give a starting point laying out the structure of the site and make views/controllers easier to reuse (as they're not coupled to URLs)[0], whereas annotating the handler directly gives a better view of where they're involved and how. [0] They also make it simpler to "graft" sub-sites in