I wrote a piece of java code using threads, JDBC, Java Mail API etc. without using any of the frameworks (read Spring). I am frankly not too comfortable learning them first (lots of terminologies to remember!) and use them. So, please suggest me some ways to refine my existing code incorporating few of these framework concepts applicable to the aforementioned things without having to learn a lot about them. Is there any quick way to learn some vital framework concepts and use it.. sounds certainly foolish, but still looking for somebody’s experiences 🙂
Share
If you aren’t interested in frameworks, your code should at least use interfaces and layering that’s appropriate. Your app will be well-layered if you have interfaces for services and repositories whether you use a framework or not.
You should have a front controller servlet that accepts all requests.
You should bind and validate all requests prior to processing in the service tier.
The services should be completely separate from your web tier. If you can’t unbolt the web UI and have the rest of the stuff work, you’re doing it wrong.