This is my first presentation of java design pattern - prototype. Everyone of us is holding a peer review paper and is told to grade our classmates. How low mark will i get graded from them (Shiver).
This is the design patterns that I had gathered in our last presentation.
First presenter: Facade design pattern
- The Facade pattern is used to make a single class represent an entire subsystem.
- The Façade pattern allows you to simplify this complexity by
providing a simplified interface to these subsystems.
- Uses the instrinsic properties to create a pool of objects that would be created once rather than being created each time the same object is needed.
- It also takes the extrinsic properties away from objects and finds a common instrinsic state among them.
- Advantage: When hundreds or thousands of similar objects need to be created, it will be taxing on the system but not so when using this pattern as it cuts the creation of the same object by creating it only once and the clients can just retrieve it from a pool of others.
Third presenter: Prototype design pattern (Me)
- The Protoype pattern is used when creating an instance of a class is very
time-consuming or complex in some way. Then, rather than creating more
instances, you make copies of the original instance, modifying them as
appropriate. - Prototypes can also be used whenever you need classes that differ only in the
type of processing they offer. - Shallow and Deep prototype design pattern
- The aim of a decorator is to extend the functionality of a core class without modifying the class so as to make code maintenance easier.
- It uses a class that takes in an original object and adds new methods or stuff to it, to obtain a desired outcome.
- Advantage: while most classes does a certain function or presentation, new functions to be added into the class need to be recoded, compiled and run while using this pattern, the object just needs to be passed into the decorator class to obtain the much need functionality
- The Chain of responsibility allows an even further decoupling between classes, by passing a request between classes until it is recognized.
- Helps to provides a class of which there can be no more than instance, and provides a single global point of access to that instance.
The presentation had given me a brief idea of what indiviual pattern is. However ,i think i have to read up more in order to catch up with my classmate. More patterns are coming next week....