Friday, September 28, 2007

Java Beans (Continue...) Part II

Begining of the lesson, we need to choose the desire pattern for our presentation. Each of us need to choose 3 design patterns and present to our classmates. I had chosen template , bridge and prototype for my java pattern design. At first i thought java will be java , but after attending this module i just need to scratch my head.... Java itself there are 23 types of main design pattern.
To catch up with all the pattern , i think i need to have sleepless night to read all the related material up ...esp. Gang of Four.

What are Java pattern?
Design patterns form a cohesive language that helps to describe classic solutions to common object oriented design problems. These patterns enable the user to discuss systems of objects as quasi-encapsulated entities. By using design patterns, it helps to solve programming problems and the proper perspective on the design process can be maintained.

Last lesson , we had briefly understand the definination and concept of Java beans. It is a concept and software component model , that when java classes adheres to , will be known as a Bean. In the 4th lesson of CBSE , the course had brought up the conventions of Java Bean.

1) Classes must be serializable or externalizable (for perisitency)
2) Need default constructor (constructir with no arguements)
3) Get and set methods for each property.
4) Requires event listeners in each class that interfaces with on another.

The aim of Java beans is to allows us to have a portable , reuseable and platform independent advantages. It also allow us to have an interface driven as well as highly customizable.Hence , user may take shorter working time to process as not much coding is to be done.

Next , how events is related to beans?
The events are related to link components.For a Bean to be the source of an event,it must implement methods that add and remove listener objects for the type of event.Hence , it helps a source Bean know where to fire events.

No comments: