is it necessary to use framework rather than normal OOP language? I mean if I want to create a timetable on the web which admin can add data in to form and save them in DB, then produce restful web service. Do I need to create the admin part with frameworks like Spring, Struts? or can I just create it with simple JSP ?
6 Answers
Frameworks are used to reduce development time and effort. You can very well develop the Admin module with plain JSPs. However bear in mind, that JSPs is less maintainable if too much of java code creeps into them.
The downside of using frameworks is they will increase the size of binary (war), and may be slower start up (in milliseconds), and need little learning curve for developer (and the one who maintains the app).
If your app'a admin part is not exceeding 3-4 pages, time spent in integrating frameworks and resolving their dependencies and other factors may outweigh their utility.
Comments
Why you need Framework(s) or what is the significance of using Frameworks apart from the OOP paradigm? Creating Back-end panel or Admin Panel is upto you whether you use like Liferay or xWiki Framework. But using these kinds of frameworks like Spring MVC, Struts 1 or 2, JSF 2, EJB 3, Hibernate ORM or TopLink would simplify your complex architectural situation in a sense for Messaging Service, for Transaction oriented implementation and lot more. These frameworks are not willing to provide built-in Admin Panel but like Liferay or any other CMS Application can do that. Those Applications are built by using Spring MVC or similar libraries or framework to be more specific. We need a little bit complex architecture to separate Business Logic from Persistence Layer and Service layer should be separated from others. And we need to make loosely coupled bonding between each layer or component. So it is up-to you whether you are following any Architecture to be more specific or just a simple
Raw Implementation. If you use Spring MVC there is concept like Acegi Security so if you need security then you can go for Spring MVC. There are many other features for Spring MVC or other frameworks as well.
Comments
If you have already built part of your app with those technologies, it stands to reason that you can continue using them to build the admin part of your app. After all, its just another part of the app.
1 Comment
A lot of the frameworks will abstract your view technology. For example, you can use Spring with JSPs, JSF, GWT from Google, Flex, etc. Grails uses SiteMesh which I've come to enjoy. I believe Play! uses straight-up Groovy files, or at least did until recent releases.
Tiles2 is also pretty easy to use, and gives you some of the basic "manage the parts" functionality so you don't wind up going down the include rabbit hole.
Here is a great tutorial that walks through a simple Spring MVC webapp with Tiles2 to help manage the JSPs. This will also give you a feel for view resolvers within Spring.
http://www.springbyexample.org/examples/simple-tiles-spring-mvc-webapp.html
Comments
If you can say with 100% certainty that your "one JSP" app will never be extended, then ok, the overhead of a framework may not be worth it. But that never happens. New features will be requested, by you or someone else, and you will find yourself wishing you had set things up correctly in the first place.