The reason for the above sentence being present in here is - anything, any object, any creature would suffer the following linear cycle stages - a) Creation, b) Growth, c) Behavior and ofcourse, d) Elimination (or Disposal). And know what? The categories of DP as well, follow these patterns strictly and the attire of them is as follows:
- Creational Pattern
- Structural Pattern.
- Behavioral Pattern
So once the client code starts accessing the Business classes by creating objects for each and every one of them... Just for an example, in a Teaching institution, the client code starts instantiating for the Student object, the Faculty Object, the Classroom object, Textbook object, Examination, Fees, Batches, and so on and on and on... The client code creating those objects, using the objects, closing the objects and disposing / releasing the objects - thus making itself too (we can even add a couple more o there) complicated to maintain and for the readability as well. Another well proven demerit in this approach is the client code is too heavily coupled with the Concrete classes. (A concrete class is one which can be instantiated directly).
So to solve these kind of issues, we have the saviour Creational Pattern. This category of patterns deals with Centralizing the object creation or to delegate the object creation.
Lets see Structural Pattern and Behavioral pattern in my next blog!!
0-0 (Love all) ;-)
No comments:
Post a Comment