Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MVC design pattern question 2

Status
Not open for further replies.

refulgent

IS-IT--Management
Jun 12, 2001
24
US
Hi Everybody,

I have an CGI (with Perl) app that became hard to support and modify over time. I did some research and came to the conclusion that it would be good to rewrite it using the oo Model VIew Controller design pattern. However I am not sure whether it will be easier to simulate MVC in Perl or to use something like Jakarta Struts framework. Could you please share your thoughts on this one with me.

Thanks a lot!

refulgent
 
Stuts is great though it can be a bit hard to get going. Struts lets you define Java 'Action' classes as your controller to do custom processing, setting objects in the session as your models, and you ideally use jsp pages to convert the objects to web pages as your view. It definately helps to separate the data layer from the presentation side and is will worth considering. Once you get struts happening, enterprise java beans are a natural progression.

Best of luck.
 
Scrat

Thanks for reply! I already started on working with struts and so far it seems to be exactly what i need. However I am not sure how to proceed with designing the whole thing yet and my friend was saying that struts are terrible and I shouldnt use them and simply use jsp and ejbs. Whats your opinion with regard to that?

Thanks a lot!
 
My response is why recreate the wheel? If Struts works for what you need it for than why not use it? There are always going to be features that you might want or need in a framework such as Struts but the great thing is that since it is open source you can get involved and add them yourself.

I have done both (used a web framework vs. rolled my own) and they both have merit. There is definitely something to be said about having total control of the system. OTOH someone that is good with a particular framework like Struts can churn out code faster than someone that has to write everything from the ground up. Play with Struts long enough and make up your own mind. BTW, Struts is not the only web framework or necessarily the best one though it is probably the most used.

As far as just using JSP and EJB... sure you could. If you want to go MVC then you will be doing a lot more additional coding to develop the framework that Struts already gives you. Furthermore, I disagree about necessarily using EJB at all. If you are just doing a standard web app (read database driven website) then you probably don't need EJB. If you don't need distributed components, transaction management, and extreme levels of scalibility (clustering) then EJB is overkill.

Good luck.
 
I decided to use Struts because it was the first implementation of the MVC pattern i found (I simply fell in love with the whole idea of MVC!) Are you saying there are other implementations out there? If yes where and which ones!?

Also about my application: it seems like my app is what you call standard database driven application. Only its somewhat big and got messy thats why I want to do it using some OO technology. Whould you still recomend using stuts or it will be also an overkill?

Another thing, do you know any web resources where I can take a look at class diagrams etc of an app which is similar to mine and is using struts because this is my first time doing it and I would love to have an example...


Many Thanks!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top