Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Neal Ford<br />Author, <i>Art of Java Web Development: Struts, Tapestry, Commons, Velocity, JUnit, Axis, Cocoon, InternetBeans, WebWork</i><br /><a href="http://www.nealford.com" target="_blank" rel="nofollow">www.nealford.com</a>
Originally posted by Neal Ford:
One of the purposes of Model 2 in all these frameworks is the separation of responsibilities. So, any architecture that supports that is a winner IMO. Each of the frameworks offers pros and cons as to how they apply in a Model 2 and this concept of separation. I discuss a lot about how and why that is important, and offer pros and cons on when you can go too far in that direction. The best example of a contrast to Model 2 is the InternetBeans framework, with is RAD development for web appliations. It violates many of the ideals of Model 2, but is great for building short lived applications really fast.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Pradeep Bhat:
Which is the best J2EE MVC frame work to use? Is it struts?
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Pradeep Bhat:
Which is the best J2EE MVC frame work to use? Is it struts?
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Nicholas Cheung:
Hi Ko Ko,
In fact, I do wanna know what are MVC model 1 and model 2.
What is the difference between them?
Thanks.
Nick.
Originally posted by Nicholas Cheung:
Hi Ko Ko,
In fact, I do wanna know what are MVC model 1 and model 2.
What is the difference between them?
Thanks.
Nick.
The Model 1 architecture
In the Model 1 architecture, the target of every request is a JSP page. This page iscompletely responsible for doing all the tasks required for fulfilling the request. This includes authenticating the client, using JavaBeans to access the data, managing the state of the user, and so forth.
There is no central component that controls the workflow of the application. This architecture is suitable for simple applications. However,
it has some serious drawbacks that limit its usage for complex applications. First, it requires embedding business logic using big chunks of Java code into the JSP page.
This creates a problem for the web page designers who are usually not comfortable
The Model 2 architecture
This architecture follows the Model-View-Controller (MVC) design pattern. In this architecture, the targets of all the requests are servlets that act as the controller for the application. They analyze the request and collect the data required to generate a response into JavaBeans objects, which act as the model for the application. Finally, the controller servlets dispatch
the request to JSP pages. These pages use the data stored in the JavaBeans to generate a presentable response. Thus, the JSP pages form the view of the application.
The biggest advantage of this model is the ease of maintenance that results from the separation of responsibilities. The Controller presents a single point of entry into the application, providing a cleaner means of implementing security and state management; these components can be reused as needed. Then, depending on the client�s request, the Controller
forwards the request to the appropriate presentation component, which in turn replies to the client. This helps the web page designers by letting them work only with the presentation of the data, since the JSP pages do not require any complex business logic. In this way, it satisfactorily solves the problems associated with the Model 1 architecture.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Nicholas Cheung:
Hi Ko Ko,
That is to say, basically, the major difference is that Model 1 puts business logic inside JSPs, while Model 2 puts those logic inside Servlets, while JSPs are only be used for "View", not "Controller" anymore. Can I say so?
Thanks.
Nick.
Originally posted by Pradeep Bhat:
We had used our own frame work beacuse of the struts learning curve.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Ko Ko Naing:
In my own opinion, I guess applying struts is much easier than building our own framework... But it also depends on the specification of the web app that we are developing... Maybe the web apps that you've developed so far does not fit into the strut framework... Is it the main reason why your company apply their own framework, rather than struts?
Thanks...
Originally posted by Nicholas Cheung:
Hi Ko Ko,
That is to say, basically, the major difference is that Model 1 puts business logic inside JSPs, while Model 2 puts those logic inside Servlets, while JSPs are only be used for "View", not "Controller" anymore. Can I say so?
Thanks.
Nick.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Nicholas Cheung:
Hi Ko Ko,
I feel this is because they think it is easier for code development. Since you put every logic there, you have no need to cater for other people's work.
However, it is very difficult for maintanence or enchancement because it is not that easy to find out where the developer puts the code inside which JSP.
Nick.
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Originally posted by Nicholas Cheung:
Hi Ko Ko,
I feel this is because they think it is easier for code development. Since you put every logic there, you have no need to cater for other people's work.
However, it is very difficult for maintanence or enchancement because it is not that easy to find out where the developer puts the code inside which JSP.
Nick.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Nicholas Cheung:
However, for J2EE to replace PHP, I think this may or may not happened. I know Java is trying to take over PERL, since from JDK 1.4, it provides Regular expression that perform the same way as PERL does. But PHP is indeed easy to code (just like shell scripts are more effifient than C program for the same task, and less complex). And the JSTL is a bit more difficult for Web designer (the aim of MVC and JSP is that Web designer can write HTML code in JSP for the display, while the data is obtained from either JavaBean or simple JSP scriptless). It is hard for them to work with JSTL.
Originally posted by Chris Mathews:
Java is not trying to take over Perl, nor is J2EE trying to replace PHP. J2EE and PHP are not even in direct competition. J2EE covers a much broader scope than PHP could ever hope to. J2EE and PHP are in fact complementary technologies and there is currently work being done in JSR 223 to allow PHP to be used as a frontend scripting language in J2EE as an alternative to JSP.
[ February 11, 2004: Message edited by: Chris Mathews ]
<%@ page language='php'%>
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Anthony Smith:
Can Sturts and Jakarta Turbine work together?
Originally posted by Ko Ko Naing:
Mr.Neal, is there also any section in the book mentioned about the current technology in the market, compared to the J2EE world?
Neal Ford<br />Author, <i>Art of Java Web Development: Struts, Tapestry, Commons, Velocity, JUnit, Axis, Cocoon, InternetBeans, WebWork</i><br /><a href="http://www.nealford.com" target="_blank" rel="nofollow">www.nealford.com</a>
Originally posted by Neal Ford:
My book only covers Java web development -- I didn't have space to cover a subject as vast as comparing web development technologies.
My favorite framework is...it depends! I ended up really liking Struts, Tapestry, and WebWork (and Velocity is my favorite template engine).
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |