Tuesday 3 April 2007

Lecture 06.03.07 Part B - Critiquing Course Work

There are 5 tasks given in the course work and only 4 tasks are to be completed. Each Task is woth 25%. Those task are as follows:

Task 1 - Designing with Patterns
Task 2 - Coding with Patterns
Task 3 - Patterns and Software Development
Task 4 - Critiquing Patterns
Task 5 - Patterns Blog

We are suppose to critize each Task.

TASK 1
In order to complete this task, we have to know UML diagrams. This task imposes force to have good understanding of the fundamental concepts used in object-oriented programming, mainly class diagrams, use case diagrams and sequence diagrams. The 25% marks are allocated according to the understanding and evaluating those patterns.

TASK 2
In this section we are to explore a particular programming language and coding. In order to achieve a working prototype a good knowledge of object oriented programmng language is essiential.

TASK 3
In this task we are exposed to incomplete Pattern designed by someone else and its an oppurtunity toinvestigate and provide a solution to the problem. In order to be in a position to give a solution it is essiential to have suffiecient understanding of the 23 design pattern by GOF.

TASK 4
By critiquing, we are actually given a platform to understand the rationale of a particular topic in more depth, which gives us a chance to explore further and contribute a easier way of putting forward an idea or concept.

TASK 5
In this task we asked to post at least 12 blogs and the 8 best blogs will be choosen for marking pupose. All this blogs created are related to the subject we are learning. Why are we asked do so? Simply, because creating blogs gives an oppurtunity to confidently post their understanding and bring out doubts. Therefore, this learning curve gives one to have an open mind to new ideas and accepting the rejections positively. This is essiential for any evolving area.

The course work is designed for one to understand in overall. Having basic knowledge of object oriented programming language and to further understand the design patterns one will have to further understand the principles of each every pattern as they all have uniqueness of its own. Besides that, confidence, critizing and evaluation is the essential bit of the course work.



Monday 2 April 2007

Lecture 06.03.07 - Definition of Abstract Factory

Definition of 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]

OR

In short it is defined as, providing an interface for creating families of related or dpendent objects without specifying their concrete classes. [2]


Below, I am going to illustrate an example which was used by my lecturer:-

In the STUDENT class, there is data and methods. The data is student names which comprises methods such as enrolment, add, create, edit, delete and print.
Its the same with the class named COURSE, there is data and methods. The data will be types of courses available and the methods will be registration, add, create , edit, delete and print.

Now, abstract class will create a common interface which will perform all the functions such as add, create, edit, delete and print in new abstract class named may be FUNCTION class. This proves that the concrete class is isolated and its easy as the concrete class produces different product family configuration.

---------------------------------------------------------------------------------------------------
Reference Link

[1] http://en.wikipedia.org/wiki/Abstract_factory

[2] http://www.c-sharpcorner.com/uploadfile/mosessaur/abstractfactoryadonet202152006053643am/abstractfactoryadonet2.aspx?articleid=4468e7cc-57cl-4738-8e83-a8db48fd1d9f



Lecture 27.02.07 (B) - Critiquing one of the GOF Design Pattern, Adapter Pattern

In this lecture we all were introduced to the 23 GoF Catalogue Patterns. Brief knowledge was obtained and I am taking the ADAPTER PATTERN a little futher by critizing the 11 elements in this catalog pattern.

Name
Adapter pattern makes one interface match to another. It acts as a plug in.

Intent
Converts the interface of a class into another interface a cliets expects.

Also Known Uses
Its also known as Wrapper.

Motivation
This section elaborates about how existing and unrelated classes come into one application and from there on how there are made compatiable to work on a same interface. It also emphasises on a problematic area and from there on it vastly builds into addressing those issues by introducing different approaches. Besides that, having a diagrammatic viw in adapter pattern illusrates the fullfilling of responsibility of each class.

Applicability
In this section it clearly states where and when it should be used to adopt the interface.

Structure
This element overlaps with the MOTIVATION element because this class adapter uses multiple inheritance concept to adpt one interface to another and this information can be incorporated into MOTIVATION element as mentioned in the begining.

Participants
The advantage here ist that it clearly devides the domain interface use by the client, works together with objects conforming the target interface, defines the interface need ofadpating, and adapting the target interface. In short it can briefly demontrates and identify the obtainability of relationship.

Collaborations
In this section, the association here emphasises on the UML diagrams.

Consequenses
Information such as the do's and don'ts, characteristics of the adapter pattern, rules of the adapter pattern. In short, this element provides all the principles of adapter pattern when come to implementing them.

Implementation
Here the implementation is applied on C++ to display hierarchical structure. Three(3) types of implementation approach is used and they are abstract approach, usage of delegate objects and parameterized adapters. All this three approaches are used together which is much easier to be introduced rather than implementing them separately using TREE display.

Sample Code
In my opinion, sample code element need not be given great emphasise as it can be illustrated in any language. Creating the source code can be time consuming and lenghty process.

Known Uses
This pattern has been used on the following systems: InterViews 2.6 defines an Interactor abstract class and a Graphic abstract class. Both have graphical appearances but they have different interfaces and implementations (they share no common parent) [1]

----------------------------------------------------------------------------------------------------------------
Reference Link:http://www.vico.org/pages/PatronsDisseny/Pattern%20Adapter%20Object/index.html [1]