Jooby a modular micro framework Overview is a micro-framework for building web applications in and . If this is first time you heard about ? Checkout my previous article on . Jooby modular Java Kotlin Jooby why you should choose Jooby Micro-frameworks are ideal for building small applications, but are they good for medium or complex applications? In this article we’ll learn what options offers to build web applications and keep the source code and . Jooby large scale organized maintainable Initial application development Let’s say you want to build a HTTP API for users. An initial application might looks like: Done! Your application is ready. It looks clean and easy to understand. . Simplicity is one the Jooby goals Large scale application development Suppose you want to extend your application with: A HTTP API for blogs. A HTTP API for comments. UI for users, blogs and comments. We can keep what we did before and extend the number of lines in our . It is perfectly fine to do that, after all you own the application :) App.java But what if you want to ? How can you? This is missing feature for most micro-frameworks but not in . better organize your source code Jooby provides some features and patterns that let you compose and organize your application. Jooby MVC routes (a.k.a. Controller) This is well-known pattern in frameworks were you annotated methods and make them accessible via HTTP: Java We can replace the with our new controller so now our application looks like: script routes You can apply the same pattern for blogs, comments and UI controllers: This is how you usually split an application into multiple components using controller classes and annotations. Wouldn’t be nice if we can keep the and keep source code organized? script routes Embedded applications This pattern let you compose one or more applications into one big application. It’s perfect if you love and want to keep them organized. script routes We split our application into 4 components, like we did before with controllers. But this time each component is an : application by itself Time to embedded it as we as we did in the controller example: This approach let you build standalone applications that can be easily embedded into a major application. Conclusion In this article we illustrated how to build large scale applications with Jooby using or . MVC script routes Some users prefer over , but the truth is that you can use both or . just make sure to give you the right tools. Like always, decision is yours. MVC routes script routes mix them together Jooby That’s all for now. Thank you for reading! If you are not yet convinced about here is nice article on why you should give it a try: Jooby Java micro-frameworks: Why Jooby?
Share Your Thoughts