|
Subject:
|
MVC Design Issue
|
|
Posted By:
|
gopalkis
|
Post Date:
|
9/20/2003 4:25:07 AM
|
Hi I am new to designing, I am not able to confirm whether my design explained below is a valid or proper one, should I improve in any other place.
M - Stateless session bean having methods for insert, update, delete, view,
V - Jsps, html, js, images
C - A single servlet for a single JSP
Sample addUserGroup.jsp on submit it redirects to UGACtrler populates javabean UsrGrp and instantiates UserGroupBean ejb and calls the corresponding method for inserting or updating.
updateUserGroup.jsp on submit it redirects to UGUCtrler populates javabean UsrGrp and instantiates UserGroupBean ejb and calls the corresponding method for inserting or updating. and it goes for all database operations.
Please suggest me whether this is a proper way of doing it.
regards
|
|
Reply By:
|
Indian Ocean
|
Reply Date:
|
9/20/2003 3:43:00 PM
|
Yes dear that is right design pattern what you understand. actually model contains mainly entity beans for what you have written staateless session beans. it will better to use entity beans.
Indian Ocean "Rago Me Daudate Firne Ke Hum Nahi Kayal; Jo Aankh Hi Se Na Tapka To Fir Lahoo Kya!"
|
|
Reply By:
|
yasir_lahham
|
Reply Date:
|
9/21/2003 3:00:52 AM
|
Yes, that's right, MVC Divides interactive applications into three distinct components: Model: Contains core functionality and data. View: Displays information to user. Controller: Handles user input. also it Includes a change-propagation mechanism to Ensures consistency between user interface and model.
Model: -Encapsulates data. -Exports procedures that perform specific application processing (used by Controller on behalf of user). -Provides functions to access Models data(Used by View, maybe Controller too). -Manages change-propagation mechanism. Maintains registry of components dependent on the model. Views and controllers register their need to be informed about changes. Changes in state of model trigger notifications. Responsibilities include: Providing functional core. Register dependent views and controllers. Notify dependent components about changes.
View -Presents information to user(Different Views present information in different ways). -Defines an update procedure that is activated by change-propagation mechanism in Model. -Retrieves current data values to be displayed from Model. -During initialization, associates itself with Model and registers for change notification. -Corresponds to a single Controller. -Offers functionality that allows Controller to manipulate display(E.g. scrolling).
Conroller: -Accepts user inputs as events. -Translates events into requests for the associated Model or View. -Registers itself with Model if it depends on state of the Model in any way(E.g. A certain change in the Model results in a menu item being enabled or disabled).
from a document by: Dr. Roger T. Alexander rta@cs.colostate.edu
MHD Yasir Al-lahham
|
|
Reply By:
|
gopalkis
|
Reply Date:
|
9/21/2003 11:15:20 PM
|
Hi Thanks for all, I got a clear picture now, I will try to implement with Entity Beans. Thankz once again.
regards
|