Showing posts with label Design Pattern. Show all posts
Showing posts with label Design Pattern. Show all posts

Monday, 26 August 2013

what MCV design patterns and entity bean ?

Introduction

MVC is a design pattern (a general design solution for problem solving) widely used in software design. 
MVC Stands for Model Controller View. 
MVC is achieved through 3 components: 
  • the model contains the data and provides methods for accessing them;
  • The view displays the data in the model;
  • the controller receives the commands(usually through the view) and implement them by changing the status of the other two components

This pattern ensures the division between business logic(managed by the model) and user interface (run by and view controller). 
Wanting to apply this pattern to the Java EE, you can use the following Java technologies applied to various components of the pattern. 
Model: This component can be implemented through the entity bean and session bean Controller: It can be implemented by the servlet. View: The latter through jsp and / or jsf. 
In general terms, entity objects encapsulate the business policy and data for
  • the logical structure of the business, such as product lines, departments, sales, and regions
  • business documents, such as invoices, change orders, and service requests
  • physical items, such as warehouses, employees, and equipment

The entity bean will be an abstraction and then to represent the data, the session bean can perform operations on the entity, the servlet will collect input from jsp (you) to make requests to the session bean and communicate results to jsp and so on. 


Related issue :


Wednesday, 17 July 2013

Observer design Pattern with Examples .#Java

Observer design pattern  is a fundamental core pattern where Observe watch for any change in state or property of Subject. 

For Example Company updates all its shareHolder for any decision .

they make here Company is Subject and Shareholders are Observers, 
any change in policy of company , the company will notifies all its Shareholders (observers).



What is Observer design Pattern?


Observer design pattern is very important pattern and as name suggest it’s used to observe things. Suppose you want to notify for change in a particular object than you observer that object and changes are notified to you. Object which is being observed is refereed as Subject and classes which observe subject are called Observer

This pattern is used heavily along with Model View Controller Design pattern where change in model is propagated to view so that it can render it with modified information.