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).

Sunday, 29 April 2007

Abstract Factory Pattern

Abstract Factory Pattern:
A software design pattern, the Abstract Factory Pattern provides a way to encapsulate a group of individual factories that have a common theme. In normal usage, the client software would create a concrete implementation of the abstract factory and then use the generic interfaces to create the concrete objects that are part of the theme. The client does not know (nor care) about which concrete objects it gets from each of these internal factories since it uses only the generic interfaces of their products. This pattern separates the details of implementation of a set of objects from its general usage [1].


For example, a user is using a computer system. He is not aware of different processes taking place in it. RAM is designed to function in its own way in contrast to other parts of the system. Behind, there are different logics running but for the user, it is only a single click away before his job gets done within seconds.

Reference:

[1] http://www.answers.com/topic/abstract-factory-pattern

Monday, 23 April 2007

Strategy Pattern

Strategy pattern:
Strategy pattern is an exacting software design pattern in which algorithms can be chosen to implement while in running mode. It is beneficially used in those cases where it becomes needy animatedly to switch the algorithms within the same software. Its main job is to provide or give the understandable meaning to identify a family of algorithms, put each one of them in a nutshell as an object that result them interchangeable. Another job it does is let the algorithms show a discrepancy independently from clients that use them [1].

For example, whenever you want to add, remove, or change any of the performance as such it is a very easy task because each one is its own class. Each of these actions or algorithm encapsulated into its own class is called strategy pattern [2].

References:
[1] http://www.answers.com/strategy%20pattern
[2]
http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/StrategyPattern.htm

Adaptor Pattern

Adaptor Pattern:
According to The Gang of Four (GoF) “Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.”

When we develop the coding with the help of object-oriented programming languages, it tends to happen that we end up using a class that is unavailable within the active classes within the system. In this case, it is advisable to create an adaptor (also known as wrapper). This adaptor should be capable to be wrapped around the external class which will enable it to communicate with the existing class.

Reference:
http://www.c-sharpcorner.com/UploadFile/rajeshvs/AdapterPatternInCS11142005005135AM/AdapterPatternInCS.aspx.

Decorator Pattern

Decorator Pattern:
The Decorator Pattern is used for adding additional functionality to a particular object as opposed to a class of objects. It can be easy adding functionality by entire class objects of by subclassing an object you can try single objects this way and leave other like unmodified. Also decorator pattern is known as wrapper which the object interface identical to an object decorator can add and remove object without client realizing Decorator in a situation where you want to change the behaviour of an object repeatedly (by adding and subtracting functionality) during runtime.


Reference:

http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/DecoratorPattern.htm

Anti-patterns

An anti-pattern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences [1].

If a pattern represents a “best practice”, then an anti-pattern represents a “lesson learned.” Initially proposed by Andrew Koenig in the November 1995 C++ Report, there are two notions of "anti-patterns [2].”

1. Those that describe a bad solution to a problem which resulted in a bad situation.
2. Those that describe how to get out of a bad situation and how to proceed from there to a good solution.

People think that the presence of patterns are really important in successful development of a system which is right but in the meanwhile the presence of anti-patterns make that system robust which is not being accepted and considered at a wider scale.

Writers Brown Malveau, McCormick and Mowbray wrote a book called Anti-Patterns in which they spoke about refactoring software, architectures, and projects in crisis. It is their aim to go one step beyond to recommend a course of action for alteration, recuperation, and prevention [2].

They show us how to turn lemons into lemonade and how to avoid subsequent lemons, leading us away from the misfits of anti-patterns, and back towards the patterns that resolve them [2].

References:
[1] http://www-128.ibm.com/developerworks/webservices/library/j-bitterjava/index.html
[2] http://www.cmcrossroads.com/bradapp/docs/patterns-intro.html#KindsOfPatterns

Monday, 12 March 2007

Critisizing the coursework

I was very glad to visit my parents but on the other hand, I was stressed because I missed an important part of my lectures in terms of Jane Chandler’s visit to St. Patrick’s International College, London, who is a Unit Co-ordinator of Designing Patterns at the Portsmouth University.

The session heated up by all the relevant questions and answers with regards to the coursework was an interesting and knowledgeable part of this particular module. I am lucky to have such helping class fellows who updated about it. Besides, I had some difficulties to understand bits of it that were cleared by the help of Dr. Sri.

Task 1:
In it, we have to make UML diagram which almost sound like what we have done at HND level. It’s not easy. It needs brainstorming and good research techniques to complete it.

Task 2:
It is programming based. A good programming knowledge may lead to its completion.

Task 3:
It is about completing an incomplete blog out of the Temporal Patterns. As of yet, I am not too sure to adopt one particular preserving technique in order to begin with this task but in a very near future I will be deciding on to select one in order to proceed forward.

Task 4:
It’s view is not the one I support. I am in favour of patterns. In my view, life is based of some routine patterns that we don’t consider at all the time but if we look at it closely, we will realize, its all about their integration in different ways within several contexts.

Task 5:
It is a fun part. I enjoy doing it more than I enjoyed when I came to know about it. I am registered with few forums where there is a constant exchange of information. For e.g., in one of the forums, we swap knowledge about daily problems and troubleshooting techniques faced while using PCs.

Research a Pattern

Research on a Pattern:
I have researched and managed to find out about a pattern that is completed in a different preserving method. Yahoo has invented their own designing patterns catalogue. One of them is described under:

Tool Tip Invitation [1]:
This kind of pattern comes under the category of invitation in its design pattern catalogue.

Problem Summary:
Designer needs to cue the user about what will happen if they click the mouse on the hovered object.

Use When:
• You want to invite the user to click or interact with the object being hovered over.
• You want to make it clear that something will happen when the user clicks on the object being hovered over.
• The user is interacting directly with the object (e.g., inline editing).
• You need a textual description to make it explicit what will happen when the user interacts with the object.
• You want to entice the user to interact with the feature.

Solution:
• Provide a tool tip when the mouse is over the target area that calls the user to action.
• Show the tooltip within a very short amount of time (< .25 second) or immediately when the mouse hovers over the interaction area. • Keep the tooltip visible the whole time the user has the mouse over the interaction area. • Remove the tooltip when the mouse leaves the interaction area.

• Provide a short phrase that calls the user to action. • Use verbal phrases like 'Click to Edit'.

Reference:
[1] http://developer.yahoo.com/ypatterns/pattern.php?pattern=tooltipinvitation

Thursday, 8 March 2007

FAQ

What is patterns and anti-patterns?
Patterns:
A pattern is a named piece of instructive information that captures the essential structure and insight of a successful family of proven solutions to a recurring problem that arises within a certain context and system of forces [1].

Anti-Patterns:
If a pattern represents a "best practice", then an anti-pattern represents a "lesson learned." Initially proposed by Andrew Koenig in the November 1995 C++ Report, there are two notions of "anti-patterns" [1].

Those that describe a bad solution to a problem which resulted in a bad situation. Those that describe how to get out of a bad situation and how to proceed from there to a good solution [1].

What are software patterns?
Software patterns development is one of the hot topics to flash out from the object oriented community. Popular form of software engineering problem solving discipline that has its roots in a design movement of the same name in contemporary architecture. Fundamental to any science or engineering rule is a common language for expressing its idea and language for attach them together. The role of patterns within the software community it to create a body of literature to help software developers resolve persistent problems encountered throughout all of software development [1].

How patterns helps software engineer?
The role of patterns within the software community it to create a body of literature to help software developers resolve persistent problems encountered throughout all of software development. Pattern shares the solution of various problem to help them. Properly codifying these solutions and their relationships lets us successfully capture the body of knowledge which defines our understanding of good architectures that meet the goal of their users [1].

What are kind of design patterns?
According to GOF there are few kinds of design patterns which are as follow:

Architectural patterns:
An architectural pattern expresses a fundamental structural organization or schema for software systems. It provides a set of predefined subsystems, specifies their responsibilities, and includes rules and guidelines for organizing the relationships between them [1].

Design Patterns:
A design pattern provides a scheme for refining the subsystems or components of a software system, or the relationships between them. It describes commonly recurring structure of communicating components that solves a general design problem within a particular context [1].

Idioms:
An idiom is a low-level pattern specific to a programming language. An idiom describes how to implement particular aspects of components or the relationships between them using the features of the given language [1].

Conceptual patterns:
A conceptual pattern is a pattern whose form is described by means of terms and concepts from an application domain [1].

Programming patterns:
A programming pattern is a pattern whose form is described by means of programming language constructs [1].

What are the qualities of pattern?
Encapsulation and Abstraction:
Each pattern encapsulates a well-defined problem and its solution in a picky domain. Patterns should provide crisp, clear limits that help come together the problem space and the solution space by parceling them into a network of distinct, interconnected fragments [1].

Openess and Variability:
Each pattern should be open for expansion or parameterization by other patterns so that they may work together to solve a larger problem [1].

Equilibrium:
Each pattern must realize some kind of balance among its forces and constraints. This may be due to one or more invariants or heuristics that are used to minimize conflict within the solution space. The invariants often typify an underlying problem solving principle or philosophy for the particular domain, and provide a rationale for each step/rule in the pattern [1].

Reference:
[1] http://www.cmcrossroads.com/bradapp/docs/patterns-intro.html#KindsOfPatterns

Patterns

What does a pattern mean to me?
According to answers.com pattern is a shape, prosier, model or idea (or, more theoretically, a set of rules) which can be used to make things or type of a thing, especially if the things that are generated have enough in common for the basic pattern to be indirect or discerned, in which case the things are said to exhibit the patterns [1].

What I personally think about patterns is way to understand some problem and then search for solution but there is no guaranty that patterns you using might goes successful or failed.

Name:
Get your self confidence back.

Problem:
How can a person who used to drive before but after a big accident loses his self confidence that he can be on the wheels again, so can he get his self confidence back?

Context:
Million of drivers out there on road the stop fellow the complete rules of traffic after clear there license test. They think of their self rally racer and start driving very fast and wrong way and then they end up with some accident in which they lose there life or the other persons life which is very hard for some to accept that he kill some one which for his foolish fun. That the time when some sort of scariness get in to that persons heart.

Solution:
There is many way to solve one problem which applies and get the same results:

1. He should start taking the driving classes again this way he can kill the scariness which is in side of him.
2. He should start going out with his family and friends who give him nice ideas and back him up to get over it.
3. He should go online and register himself with some form where he face or chat with some people who having the same problems so he can post his problem and get some comments on it.
4. The best way he should kill the scariness in side of him and start facing the real life that after every sunset there is new run rise.

Reference:
[1] http://www.answers.com/what%20is%20patterns%3F