Monday, 30 April 2007

Criticism on Abstract Factory

Abstract Factory:
1. Intent:
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

I think, Intent is very important in patterns, which gives meaning of value to achieve the objectives and makes things easy to understand.

2. Also known as:
Kit.

I am in favour of also known as, because the reader should know it by all the names so that it can be taken in use as many ways as possible.

3. Motivation:
To my believe motivation plays an important part in patterns and in real life. For example, all the comfort in the form of invention like television, satellite, videos, tape recorders, vacuum machines, cookers, are a result of someone’s motivation.

That’s the main reason. I am in favour of motivation.

4. Applicability:
Define the applicability is very important because without knowing it, it can be brought in our lives. It is like a commercial of a product. Until you don’t believe that it is good for you, until you don’t know that thing exists, you can’t accept it, so applicability place very important role in real life.

5. Structure:
Whenever you buy a product from outside, you get a manual with that product that basically tells you how to use it. Sometimes manuals are just dictated and sometimes a manual with pictures on it but lacks of information.

I am in favour of step-by-step instructions with the snapshots that makes user to handle things easily without wasting time. When user go through these kinds of manuals, product are very easy to use without making any mistake.

6. Participants:
I am also in favour of participants and to prove myself, I can give an example of an ERD where all the entities are created in their own field where something is unique ID, and other fields do their own jobs and if we use them same way or if we don’t differentiate, then the functions will not work properly, so participating these entities are as important as different from each other, easy to understand and access.

7. Collaboration:
I am in favour of collaboration. For example, the Java Virtual Machine runs with collaboration of other operating systems. If this collaboration is missing, it will be impossible to run the operating system by the users and hard to update.

8. Consequences:
I am in favour of Consequences. A good example can be like whenever you log off from your computer account, all your profile and settings get close. On the same computer when another user logs on, he can’t see what you been doing. So basically, it changes the whole profile of the user which is not possible without the abstract factory.
In abstract factory, all the elements work together to give you one result. A best example to understand this thing is a car. All the systems of the car work as an element. As a result, the car moves and does whatever the driver likes. Abstract factory works in the same format.

In above paragraph, I mentioned an example of a car. Everything that has been created by the manufacturer, works in a same way it has been created. It moves and takes you to your destination but if you want to add something new in that car, you can’t. Let say, if you want the car to fly, you can’t add that option in the car once it has been made, because this car has been made to run on the road.


9. Implementation:
I am 100% in favour of implementation because all the research and your imagination you have gone through can be described under the implementation. It is the final stage of any research where you find out the drawback or how much your project is capable or successful because researcher creates something, he can’t think as a user but when he implements his project, user can give him an idea to make his product more robust.

10. Sample code:
I think, simple code is required separately because when a programmer comes and reads it, it will be more easy for him to understand it.

11. Known uses:
I am in favour of known uses. The good example of known uses is Win XP and Win Vista because the user has already used Win XP. For them, migration towards Win Vista is not a big deal. They already know most of the uses. Items and the elements of Win XP are same as Win Vista.


12. Related Patterns:
I am in favour of related patterns. For example, Nokia has its own N series phones. They can only be beaten by PDA phones like MDA Vario because they include both pocket PC and phone but these both do the basic same function that is making phone calls and sending and receiving SMS.

Reference:
Pages 124-132, Design Patterns CD Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides (Addison-Wesley 1998).

No comments: