There's been a lot of news in the enterprise world lately, specially in the web, and I've decided to build a small web framework on top of Netty to learn more about asynchronous programming and event-driven architecture. In my daily job, we're using Spring for almost everything. I want to break those chains and create something simple and efficient, to learn more about this new way of doing this.
To start, I need two things: A dependency injection container and a router. I also need a front-controller object, that will send stuff from Netty to the rotuer. I've been thinking about doing a decorator stack, which implement a method like this:
Response handle(Request request)
So, the front controller sets up the stack and sends the handle message. The decorators start running and then you can get the final Response object that will be sent by the front controller to Netty.
Is this too "object-oriented" and not event-driven? How can I adapt this to the non-blocking I/O mentality? Should the router be a promise or something?
How would you guys architect this system?