• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mr.Neal, which architecture in the history in the Book?

 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to know which architecture are compared to the J2EE web application in the book? The one that is significant is CGI architecture... And what's more? Do u also mention the pros and cons of the different architecture in the book?
Thank you for being here...
 
Author
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the question.
The first part of my book covers the evolution of Java web development, from the CGI-ish approach of servlets, through JSP and custom tags, to arrive at Model 2. The second and third parts focus on applying Model 2, both through frameworks that support it (like Struts, Tapestry, WebWork, etc.) and how to build common kinds of application functionality (like page-at-a-time scrolling, colun sorting, etc.) without violating the tenents of Model 2.
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.
Glad to be here!
Neal Ford
Author, Art of Java Web Development
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


So do u mean that the InternetBeans framework is able to beat the model 2 in small web apps? Does that framework similar to the Model 1 architecture approach?
Thank you very much for your warm reply....
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which is the best J2EE MVC frame work to use? Is it struts?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
Which is the best J2EE MVC frame work to use? Is it struts?


It is not possible to give an absolute answer to that question... and you know it . Each framework has its own strengths and weaknesses. There is no doubt that Struts is the most widely used but it is certainly not a one size fits all solution. You need to evaluate each with regards to the requirements for particular application and determine which one is the best fit.
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
Which is the best J2EE MVC frame work to use? Is it struts?


I guess so... Mr.Neal is here to give us some tips on it.. Let's ask his personal opinion on the struts, which seems to be the best J2EE MVC framwork to be applied in most of the J2EE web apps...
So, Pradeep, do u usually use struts in the past? Or any other framework are u using in the web apps that u developed in the past?
Thanks..
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

any other framework are u using in the web apps that u developed in the past?


We had used our own frame work beacuse of the struts learning curve.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


http://www.theserverside.com/news/thread.jsp?thread_id=20685
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


Here is what I've just extracted from the SCWCD Study Kit of Mr.Hanumant... Hope it might be useful for you...


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.

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


Yes
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:

We had used our own frame work beacuse of the struts learning curve.


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...
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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...


We had to build an MVC framework in a short time and struts was obviously the first choice but not many knew struts so we developed an MVC framework in a short time which with a very short learning curve. We were concerned with the peroformance of struts as it used lot of reflection.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


Yes, Nick... I even see many JSP developers here in Thailand still use Model 1 architecture for small web application.... It is becoz here they use a lot of PHP and seems like they tends to get Model 1 architecture from PHP web programming.... Putting a lot of controller code in PHP pages...
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


java.sun.com/blueprints/corej2eepatterns/ Patterns/FrontController.html
 
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ko Ko,
In my company also, we use to have custom MVC framework but that was because there was no struts at that time. Now we have shifted our code to struts, as it is far more simple.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


BTW, Nick, I'm surprised that u don't know about the models(1 and 2)... Experienced person like u know much more than me, I'm sure... I think u just overlooked the terminology used in J2EE...
I'm also now learning the mechanism of PHP as well, to compare the techs used in j2EE and PHP.. But they are far different and PHP makes the developer easy to code... I guess JSP 2.0 will one day make PHP developers to be interested in JSP 2.0 and move to J2EE... But the complexity of J2EE is still preventing the PHP developers to move into the J2EE world...
What's your opinion, Nick?
Mr.Neal, is there also any section in the book mentioned about the current technology in the market, compared to the J2EE world?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ko Ko,
I have skipped the section about MVC discussed in Mr. Hanumant's book, as I think I know it. But in fact, I even dont know there are 2 models of MVC.
Personally, I feel Structs is a good standard to fulfill the MVC model, the JSPs act as View only, while the ActionForm defines the workflow (controller).
As said by Mr. Neal, one of the advantages for Structs over JNDI lookup is that the overhead. JNDI loopup in fact is an expensive operation, while Structs seems do it better in this aspect.
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.
Nick.
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.


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 ]
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]


That's a great news! Does it mean that the second possible value of the language attribute in the page directive will be php?
Something like this?


<%@ page language='php'%>


Since the php has a bunch of ready-made functions available to the developers, I think it would make the web scripting easier than before, especially in the web app dealing with MySQL database...
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can Sturts and Jakarta Turbine work together?
 
Chris Mathews
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Anthony Smith:
Can Sturts and Jakarta Turbine work together?


Turbine is a full-fledged web framework so in many respects it is a direct competitor to Struts. Keeping that in mind, the scope of Turbine extends much further than Struts as they try to provide a framework for every type of service under the sun (including scheduling, security, persistence, ioc, caching, etc.) That said, the people behind Turbine have tried to make it easy to use various services independently of the web framework itself. Therefore, it is conceivable that you could use Turbine for its underlying service architecture while integrating Struts to use as a web framework.
 
Neal Ford
Author
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?


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).
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).


Thanks a lot for your reply and opinion... It's really really great that we have you here in JavaRanch....
reply
    Bookmark Topic Watch Topic
  • New Topic