Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
| Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old September 20th, 2003, 04:25 AM
Registered User
 
Join Date: Sep 2003
Location: Bangalore, Karnataka, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default MVC Design Issue

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
  #2 (permalink)  
Old September 20th, 2003, 03:43 PM
Authorized User
 
Join Date: Jul 2003
Location: Ahmedabad, gujarat, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Indian Ocean Send a message via Yahoo to Indian Ocean
Default

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!"
  #3 (permalink)  
Old September 21st, 2003, 03:00 AM
Registered User
 
Join Date: Sep 2003
Location: Abu Dhabi, Abu Dhabi, United Arab Emirates.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to yasir_lahham
Default

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 Model’s 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
  #4 (permalink)  
Old September 21st, 2003, 11:15 PM
Registered User
 
Join Date: Sep 2003
Location: Bangalore, Karnataka, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
  Thanks for all, I got a clear picture now, I will try to implement with Entity Beans. Thankz once again.

regards



Similar Threads
Thread Thread Starter Forum Replies Last Post
Design issue davetx C# 2005 3 February 16th, 2008 01:30 PM
Design issue DeborahP Access 1 March 24th, 2007 08:57 AM
Design issue debuajm Reporting Services 0 April 24th, 2006 08:11 AM
Java Design issue with UML and Design Patterns the_logical_way Apache Tomcat 0 May 31st, 2004 04:02 AM
design issue(clarification) eyan C# 0 February 19th, 2004 12:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.