View RSS Feed

Design Patterns

Design patterns in Java.

  1. Class Registration - using reflection

    by , 03-09-2012 at 08:11 PM
    Registration of the new product class could be done to the factory in case you use reflection (e.g in .NET languages or Java), without making any change in factory itself.Without being aware of the object type for creation of the objects in factory class, a map is kept b/w class type and productID. In this particular case, when new product gets added to the application then it shall be made registered to factory. No change is required in factory class code for this kind of operation.