aspose file tools*
The moose likes Struts and the fly likes MVC - what comes first? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "MVC - what comes first?" Watch "MVC - what comes first?" New topic
Author

MVC - what comes first?

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
when start building a new form, since there are 3 factors to take in mind:

1. Model / bean
3. View / Jsp
When start building a new form, since there are 3 factors to take in mind:

1. Model / bean
3. View / JSP
2. Controller / Action

(Please correct me if I got it wrong)

What is the convention to start building the components? I mean do you list the items of your form, build the design and then implement the action?

Curious

2. Controler / Action

(correct me if I got it wrong)

what is the convention to start building the componenets? I mean do you list the items of your form, buidling the design and then implement the action?

curious
Prasanth Pillai
Ranch Hand

Joined: Oct 16, 2006
Posts: 52
to a code level approach you can start with
1. the bean. (actionform)
2. action class
3. jsp
4. struts-config.xml

other files if required.

you can download very good pdfs from
http://courses.coreservlets.com/Course-Materials/struts.html
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Thanks for the tips.
Is there any particular pdf in the site with reference to my question?

Thanks again
Prasanth Pillai
Ranch Hand

Joined: Oct 16, 2006
Posts: 52
you may have a look at

www.projectrefinery.com/StrutsIntroCourse.ppt

or

http://people.apache.org/~craigmcc/apachecon-2003-struts.pdf
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here's what happens in the real world:

1. Someone gets an idea. "Hey, we really need a web application that will do ___________". Everyone ignores that person. He is soon fired.

2. Three months later, the pain of doing things the old way starts to grow and lots of people grumble about it, but nobody does anything about it.

3. Another month goes by. The pain can no longer be ignored and the higher-ups decide to get a committe together to work up some requirements.

4. Six months, many hours in meetings, and several gallons of coffee later, still nothing is decided but someone tells the analyst (me) to go ahead and make a prototype, and "we'll tell you if we like it or not".

5. I bribe the one member of the committe who wasn't sleeping to create a use case document based on what the committee wanted.

6. Using the use case document as a guide, I spend hours on DreamWeaver putting together mock-up screens with dummy data, and a little JavaScript thrown in to make the pages seem to navigate. I also design a data model and a Java model and make cute little diagrams of them.

7. When presented with the prototype, the committe argues for hours. Finally when a fist fight breaks out, the committee is adjourned and I am told to make a lot of revisions.

8. Repeat steps 6 and 7 several times.

9. Finally, I am told "We still don't like it, but we're under pressure to do something, so go ahead and build it".

10. I argue with the DBA over the data model, and after I offer him my firstborn child and all my lunch money for the next 6 months, he finally agrees to do it my way.

11. My team creates the model classes from the diagrams. At this point they are mostly properties without many methods. There is also no data access yet.

12. The team creates ActionForm classes from the data in the mock-up screens.

13. The team creates real JSPs from the mock-up screens and replace some of the html tags with Struts tags as needed.

14. We create Action Mappings, forwards etc. We also create Action classes, but at this point they are just empty shells with the correct names.

15. Using the use cases as a guide, we build each use case scenario one by one by creating the Action class logic, and also augmenting the model logic as needed. It is at this point that we add the data access logic.

16. We demo the product to the committe. Another fist fight breaks out.

17. We repeat steps 11 through 16.

18. The site goes live, everyone is happy. World peace is achieved and hunger is eliminated.

(not really, but I had to think of a happy ending!)


Merrill
Consultant, Sima Solutions
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
That was one of the most hilarious replies I�ve ever read.
Thank Merrill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MVC - what comes first?
 
Similar Threads
JSF LifeCycle Understanding problem
about struts
Test 484 ... LONG POST
NX: URLy Bird 1.3.1 Connection Factory Design
design help