• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Model2/Model3 architectures

 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is an answer marked as incorrect to the following question:
"which of the following are true about client/server based applications?":
"i) Most client/server applications follow the Model2 architecture as opposed to n-tier applications that follow Model3".
Up to here neither agree nor disagree with the answer as I don't have a clue what Model2 architecture is. After the test, the following 'user-friendly' explanation is provided:
"Choice i) indicates that 2-tier appilcations follow Model2 architecture whereas n-tier applications follow Model3 architecture. This is untrue, because it is N-tier applications that normally follow the Model2 architecture"

After reading this explanation I realised I was as 'not having the clue' as when I was taking the test.

Has anyone heard about Model2/Model3 architectures? Does anyone know?
If so, please share it, as the curiosity is killing me...
Thanks
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP Specification used to define two different model for creating Web Applications:
  • Model 1 - defined as using JSP as both the Controller and the View. Martin Fowler refers to this as PageController in PEAA.
  • Model 2 - defined as using Servlets as the Controller and JSP as the View. Most people simply refer to this as Model View Controller, though in reality Model 1 can also be a kind of MVC depending on how it is implemented.

  • Model 3? It doesn't exist.
    BTW, this is a terrible question...
    [ March 09, 2003: Message edited by: Chris Mathews ]
     
    Sanjay Raghavan
    Ranch Hand
    Posts: 148
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello,
    The purpose of that question was to introduce the concept of Client/Server systems (in Concepts and Common Architectures) and highlight how they differ from n-tier systems:
    Here's the complete question:
    --------------------------------------------------
    Which of the following are true about client/server based applications? Choose 3.
    a.Clients are typically used for data presentation, validation and for processing business logic.
    b.Most client/server applications follow the Model2 architecture as opposed to n-tier applications that follow Model3.
    c.In client/server applications, the client normally consists of the view, controller and parts of the model.
    d.In typical client/server applications, the presentation tier (windows) generally talks to controller (a data dispatcher), which then talks to objects that represent the enterprise data.
    e.Client/server applications generally have fat clients and sometimes, fat servers as well. Hence both the client and the server could offer portability problems.
    Choices A, C and E are correct.
    In 2-tier applications, clients are typically used for data presentation, validation of user inputs and processing of business logic. Hence choice A is correct.
    If you compare the functions performed by the client with the MVC pattern, the client performs the duties of the view, the controller and parts of the model. The client interacts with the database and retrieves data. This data is then assembled into the required view. For example, a window that shows all orders taken in 1 day sorted by the customer number. The client thus acts as the view in MVC.
    When some search criteria is entered and the user presses a button to retrieve necessary data, the client appropriately dispatches the request to the database interaction object that retrieves the necessary data. Here the client acts as the controller.
    Most database interaction is encapsulated in a set of database access objects. These objects perform business rules processing. Here the client performs the job of the MVC model. Some logic is also encapsulated on the server side via triggers and stored procedures. Hence it is possible that the database also performs some model tasks in 2-tier applications. Hence choice C is correct.
    Client/server applications frequently suffer from fat clients or fat servers or a combination of both. This is because either all the logic is coded in the client (4GL scripting language) or all the logic is coded on the server (through stored procedures and triggers) or a combination of both. This results in poor portability of such applications. Hence choice E is correct.
    Choice B indicates that 2-tier applications follow Model2 architecture whereas n-tier applications follow Model3 architecture. This is untrue, because it is n-tier applications that normally follow the Model2 architecture. Hence choice B is incorrect.
    Although object oriented client/server platforms may offer the tools to decouple windows and database interaction objects that is not a normal feature in 2-tier applications. Hence choice D is incorrect.
    --------------------------------------------------
    As Chris pointed out, the MVC architecture is commonly refereed to as the Model2 architecture. The notion of Model 3 is given to just throw you off (it is coomon to mistake that 2-tier may follow Model-2 and 3-tier may follow Model-3)
    If you still have any questions, I'll be happy to answer them.
    Best luck,
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic