<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8800808806135919345</id><updated>2012-02-16T19:14:18.685-08:00</updated><title type='text'>Patterns</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-961384798596958085</id><published>2007-05-14T14:09:00.001-07:00</published><updated>2007-05-14T14:57:36.729-07:00</updated><title type='text'>Anti Patterns (blog 10)</title><content type='html'>&lt;div align="justify"&gt;Anti patterns! Different kinds of questions come in to our mind when we hear this word.&lt;br /&gt;It was very interesting to hear the lecture on Anti patterns. I learnt a lot from patterns and anti patterns through out this unit. I was just looking on IBM and some other websites, trying to get more and more knowledge about anti patterns.&lt;br /&gt;Our coursework Task4 in which we have to write about anti patterns will allow us to write in detail about anti patterns. I am going to write few lines on Anti patterns and want to express briefly what I understood about anti patterns.&lt;br /&gt;An anti pattern I would is a pattern in which we produce a bad solution to solve a problem. When the wrong solution is produced at that time we don’t know that whether it is the right or wrong solution but when it is actually implemented than we realize that it was a wrong solution to solve that occurring problem. I think it is good in a way because it will allow us to learn from our mistakes so that we don’t do the same mistake in future.[1]&lt;br /&gt;Anti patterns are not used only in software development it happens more often in our real life as well. I am going to explain more about it in my Task4 of the course work.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference&lt;/strong&gt;:&lt;br /&gt;[1]Anti patterns, learned from&lt;br /&gt;&lt;a href="http://c2.com/cgi/wiki?AntiPattern"&gt;http://c2.com/cgi/wiki?AntiPattern&lt;/a&gt;&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-961384798596958085?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/961384798596958085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=961384798596958085' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/961384798596958085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/961384798596958085'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/05/anti-patterns-blog-10.html' title='Anti Patterns (blog 10)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-8134233105239372634</id><published>2007-05-07T10:24:00.000-07:00</published><updated>2007-05-09T06:07:02.982-07:00</updated><title type='text'>Strategy Pattern (blog 9)</title><content type='html'>&lt;div align="justify"&gt;I found this pattern very interesting as it gives the client to choose their requirment. Strategy pattern helps us in defining family of algorithms and of them can be encapsulated so that they can be interchangeable.&lt;br /&gt;The aim behind the strategy pattern is to make things easier for the implementation and maintenance of methods. It is also possible to use strategy pattern in software design. S&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Strategy pattern should be used when&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;1. you require different versions of algorithms&lt;/div&gt;&lt;div align="justify"&gt;2. Suppose you have many different classes which are related to each other but they differ from each other in terms of their behaviour. In this case, strategy pattern helps you in configuring a class with one of serveral different behaviours..&lt;/div&gt;&lt;div align="justify"&gt;Strategy pattern can help us in avoiding the usage of difficult data structures. [1]&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;Raghvendra Singh, accessed 7th May, 2007&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://www.theserverside.com/patterns/thread.tss?thread_id=4777"&gt;http://www.theserverside.com/patterns/thread.tss?thread_id=4777&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-8134233105239372634?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/8134233105239372634/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=8134233105239372634' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/8134233105239372634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/8134233105239372634'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/05/strategy-pattern-blog-9.html' title='Strategy Pattern (blog 9)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-7825353021908440539</id><published>2007-05-06T03:34:00.000-07:00</published><updated>2007-05-06T16:35:48.819-07:00</updated><title type='text'>Decorator Pattern (blog 8)</title><content type='html'>&lt;div align="justify"&gt;The next pattern which i am going to discuss briefly is Decorator Pattern. Its a pattern which allows an elegant OOP technique to add some extra responsibilities or you can say functionalities to a specific object of a class. You can add functionalities to all the objects or even a single object of a entire class.&lt;br /&gt;Decorator pattern is also know as Wrapper, is an object which has a interface similar to an object that it consist.&lt;br /&gt;Decorator changes the way an object appears that is totally different from subclassing.&lt;/div&gt;&lt;div align="justify"&gt;Drawback&lt;/div&gt;&lt;div align="justify"&gt;The component which is enclosed with decorator is not the same. Tests of object types may fail in this case. And there is another point about this pattern which is not impressive is by using this pattern ! lots of small objects are created which is severe stress to the programmer when it comes to debugging some error.[1]&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;Reference:&lt;/div&gt;&lt;div align="justify"&gt;[1] By &lt;a href="http://www.awprofessional.com/authors/bio.asp?a=0b1d3cef-6e66-474b-b883-f90fc4b94c36"&gt;James W. Cooper&lt;/a&gt;.&lt;/div&gt;&lt;div align="justify"&gt;C# Design Patterns: The Decorator Pattern&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://www.awprofessional.com/articles/article.asp?p=31350&amp;seqNum=6&amp;amp;rl=1"&gt;http://www.awprofessional.com/articles/article.asp?p=31350&amp;seqNum=6&amp;amp;rl=1&lt;/a&gt;&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-7825353021908440539?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/7825353021908440539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=7825353021908440539' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/7825353021908440539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/7825353021908440539'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/05/decorator-pattern-blog-8.html' title='Decorator Pattern (blog 8)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-4231439408094986393</id><published>2007-04-03T11:16:00.000-07:00</published><updated>2007-04-03T11:19:40.610-07:00</updated><title type='text'>Adapter Pattern (blog 7)</title><content type='html'>&lt;p align="justify"&gt;We had an interesting class regarding Adapter pattern. I found this pattern very interesting because it allows us to make classes work together with the help of their interfaces, the interface of the classes will make classes work together which are incompatible to interact with each other. Adapter patterns are also known as &lt;em&gt;Wrapper&lt;/em&gt;.&lt;br /&gt; This pattern should be used in solving issues such as when you want to replace a class but the interface doesn’t match OR without knowing the interfaces of the classes when we want to create a class that could be used with some other classes.&lt;/p&gt;&lt;div align="justify"&gt;&lt;br /&gt;Adapter Pattern has two types.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.Object Adapter Pattern&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div align="justify"&gt;This type of pattern has a technique in order to adapt an interface to another which I think I have never seen in any other pattern. According to the client requirement the adapter inherits the interface. Object adapters authorize the client and the adaptee to be completely decoupled from each other.   Just the adapter knows concerning both of them. &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;2.Class Adapters&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt; &lt;/div&gt;&lt;div align="justify"&gt;Multiple inheritance is used by class adapter to accomplish their goals. Class adapters are useful in situations like where there are some existing class provides services and doesn’t require to use the interface.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-4231439408094986393?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/4231439408094986393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=4231439408094986393' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4231439408094986393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4231439408094986393'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/04/adapter-pattern-blog-7.html' title='Adapter Pattern (blog 7)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-4324388327806076724</id><published>2007-03-27T17:29:00.000-07:00</published><updated>2007-03-27T17:34:06.777-07:00</updated><title type='text'>Research on new pattern: Datetime Design Pattern (blog 6)</title><content type='html'>&lt;div align="justify"&gt;Dr.Sri asked us to do some research on more patterns apart from the one we are studying in our unit. I was looking on the internet trying to find some new pattern and came across DateTime Design pattern&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Datetime Design Pattern&lt;/strong&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;Why&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;This design pattern is used to make human readable datetimes to be also formally read by the machine. The needs arises as a result of solving the practical need for human readable dates for hCalender (hCalendar is a simple, open, distributed calendaring, based on the Calendar standard).&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;em&gt;Where &amp; How it is used&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Datetime design pattern is used in hCalendar is something like this: &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;abbr class="foo" title="YYYY-MM-DDTHH:MM:SS+ZZ:ZZ"&gt;Date Time&lt;/abbr&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;where foo is the name of the class which is being applied to this date/time, the title of the &lt;abbr&gt; is an ISO 8601 date/time and "Date Time" is a friendly representation of the same date/time. [1]&lt;br /&gt;&lt;strong&gt;Reference:&lt;br /&gt;&lt;/strong&gt;[1] Where Datetime deisng pattern is used        &lt;br /&gt;http://microformats.org/wiki/datetime-design-pattern&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-4324388327806076724?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/4324388327806076724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=4324388327806076724' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4324388327806076724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4324388327806076724'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/03/research-on-new-pattern-datetime-design.html' title='Research on new pattern: Datetime Design Pattern (blog 6)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-5708399735347624290</id><published>2007-03-22T16:56:00.000-07:00</published><updated>2007-05-11T15:13:41.820-07:00</updated><title type='text'>Comment on the Coursework (blog 5)</title><content type='html'>&lt;div align="justify"&gt;Well finally we got the coursework and thanks to Jane chandler who came to our college and gave us very valuable information about the coursework.&lt;br /&gt;When I first looked at the coursework when it was handed to me and to all classmates I was scared that how I am going to do it because I have other course work to do as well, anyway when I came to know the submission date for this course work I was a bit relaxed after that.&lt;br /&gt;The course work seems to be alright, doesn’t look very easy neither very hard but It is lengthy.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TASK1 (UML Designing)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;If we talk about the task 1 which is based on UML designing in terms of Strategy, Decorator and Adaptor patterns. First of all what I think that it is not possible for anyone to complete this task unless you understand how UML diagrams are designed. If you know how to design UML diagrams than this Task is easy to attempt because we just have to come up with four UML diagrams and of course we need to design them by adapting the above three mentioned design patterns and apply them to the prototype of customer records.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TASK2 (Coding)&lt;/strong&gt; &lt;strong&gt;&amp;amp; TASK3( Patterns and Software Development)&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;I am making my mind to do task 2 (coding) but still confused I might attempt task 3 which is a bit theoretical. Although there is much possibility of doing the coding task because I have been programming since more than two years but I haven’t done programming using patterns. Task 3 is not tough as well but I am thinking what tasks should I attempt.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TASK4 (Essay writing)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I think this is most difficult question in this course work in which we have to write an essay about anti patterns and write our point of view on anti patterns. This task could have been easy if there was no specific scenario given. Writing an essay of 600 words reminds me of my school days when I use to write essays on different topics but never got a chance to write an essay related to computing and it is really hard to get good marks when you are writing an essay. I am looking forward to do my level best to take this task as my 3rd task.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TASK5 (Blog)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I love blog because we just have to write whatever we understood from the lecture given in the class so there is not as such research involved in it. So I am happy to do the blog task. Basically in this task we just have to write what we learnt from our lecturer on each class. So we didn’t understand the lecture very well the other way we can do a bit research online about the topic which was taught in the class and then write it in our own words or do referencing.&lt;br /&gt;&lt;br /&gt;Overall,Coding and the essay writing are the tasks in which we have to be very careful how are we using patterns and what are we writing about patterns, rest I think its straight forward.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;Please give your comments&lt;/em&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-5708399735347624290?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/5708399735347624290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=5708399735347624290' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/5708399735347624290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/5708399735347624290'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/03/comment-on-coursework-blog-5.html' title='Comment on the Coursework (blog 5)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-4174278777785722799</id><published>2007-03-14T17:13:00.000-07:00</published><updated>2007-03-14T17:20:21.995-07:00</updated><title type='text'>Abstract Factory (Blog 4)</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The next blog on which we were asked to understand and do research is Abstract factory. I have looked in to many websites, tried to get as much knowledge as I can and now I am going to write what I understood about Abstract factory..!&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The Factory Pattern known as &lt;em&gt;Abstract Factory&lt;/em&gt; is used to facilitate class instantiation. In the Abstract Factory pattern, a special class, called a factory, is created whose main aim is to create instances of a class.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;The factory method pattern is like defining an agreement for the creation of a given type of classes&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;An abstract factory is an object creator. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;It can produce different types of objects. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Each object that it produces is recognized by receiver of the object which is created only by the interface of that object, not by the object's real implementation. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;span style="font-family:arial;font-size:85%;color:#000000;"&gt;Objects which are produced by abstract factory are related to each other or you can say they belong to a common family&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#000000;"&gt;&lt;strong&gt;Benefits&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Abstract factory eliminates the need of classes to bind in to the code. The code deals with the interfaces, therefore it is possible that I can work with any class that implements an interface.&lt;br /&gt;It also allows the subclasses to give an extended edition of an object because it is hard to create an object within the class but It is more easy to create an object in the client directly&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-4174278777785722799?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/4174278777785722799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=4174278777785722799' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4174278777785722799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/4174278777785722799'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/03/abstract-factory-blog-4.html' title='Abstract Factory (Blog 4)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-6621338860788165653</id><published>2007-03-08T02:16:00.000-08:00</published><updated>2007-03-31T16:13:37.264-07:00</updated><title type='text'>Criticism on one the Patterns (Blog 3)</title><content type='html'>&lt;div align="justify"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Singleton&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Going through briefly on 23 patterns the one I liked and would like to share is Singleton pattern. The reason of choosing this pattern is that it is easy to understand and more explainable. After doing research on internet about this pattern according to my understanding the definition of single pattern is:&lt;br /&gt;&lt;br /&gt;“The singleton design pattern is designed to limit instantiation of a class to one object”.&lt;br /&gt;&lt;br /&gt;Singleton is most likely the most commonly used design pattern. The main aim of singleton pattern is to provide one instance for each class and a gateway where everyone can access in to it. There are many situations in which a singleton object is necessary: a GUI application must have a single mouse click, an active modem needs one and only one telephone line, an operating system can only have one window manager, and a PC is connected to a single keyboard.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;CRITICISM&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Intent&lt;/strong&gt;&lt;br /&gt;The main intention of a Singleton is to make sure to have only one instance of this class with a global point of access to it, thus avoiding the use of global variables and conflicts among them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Motivation&lt;/strong&gt;&lt;br /&gt;Sometimes! Some classes should only have one instance, and be available from everywhere; here singleton pattern can be applied. So the instance which is created by a class will have global access and the constructor of the class blocks more than one instance to be produced.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Applicability&lt;/strong&gt;&lt;br /&gt;Singleton pattern can be used in this case when:&lt;/span&gt;&lt;/div&gt;&lt;p align="justify"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;There should be only one instance of a class and can be accessed by many clients from a well known point. If some global object is a client of another one, the latter may not be destroyed until the former terminates. No distinction between individual and composed objects.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Structure&lt;/strong&gt;&lt;br /&gt;Structure of Singleton Pattern is in the form of a diagram in which the structure is described of how the class can be limited to one instance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Collaboration&lt;/strong&gt;&lt;br /&gt;The thing I like about singleton is that and would like to share is that Clients get the right to access a Singleton instance only through the operation which is performed by Singleton's Instance.&lt;br /&gt;&lt;strong&gt;Consequences&lt;/strong&gt;&lt;br /&gt;The Singleton pattern has several benefits:&lt;br /&gt;1-Each instance is controlled properly in such a way that it limits the clients control on it depending how and when they try to access it.&lt;br /&gt;&lt;/p&gt;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;p align="justify"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;2-&lt;em&gt;Limits the size of name space.&lt;/em&gt; As we all know now that singleton pattern creates only one instance of a class therefore it also provides perfection over global variables.. It avoids polluting the name space with simultaneous access. There is a possibility that there could be a subclass of a Singleton class and It is very easy to configure a program with the help of an instance of the extended class.&lt;/span&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;br /&gt;To implement a Singleton patter, class is created with a method which creates a new instance of the object if the object is not there. If an instance is already there it simply returns a reference to that object. To prevent the object to be instantiated in any other way, a private or protected constructor should be created.&lt;br /&gt;&lt;strong&gt;Sample Code&lt;/strong&gt;&lt;br /&gt;Here is a sample of how singleton is used in programming.&lt;/span&gt;&lt;/p&gt;&lt;div align="justify"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;public class Singleton&lt;br /&gt;{&lt;br /&gt;private static Singleton NEWINSTANCE = new Singleton();&lt;br /&gt;private Singleton() {}&lt;br /&gt;public static final Singleton getInstance()&lt;br /&gt;{&lt;br /&gt;return NEWINSTANCE;&lt;br /&gt;}}&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Known-Uses&lt;br /&gt;&lt;/strong&gt;In this section, the known uses of this pattern can be understood with the help looking in to examples.&lt;br /&gt;Suppose if we are authorized to have only one license of a particular database, Singleton takes care that only one connection has been to the database to access records and suppose if we had more connections to the database then singleton can also adjust more than one connections. [1]&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Related Patterns&lt;/strong&gt;&lt;br /&gt;Singleton pattern is mostly used with Abstract Factory, Builder, and Prototype. The Singleton is a bit similar to a Cache manager, but with one object.&lt;/span&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;Reference:&lt;/em&gt; &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;[1]Example of Singleton&lt;/div&gt;&lt;div align="justify"&gt; &lt;a href="http://www.javaworld.com/javaworld/jw-01-2001/jw-0112-singleton.html" target="new"&gt;http://www.javaworld.com/javaworld/jw-01-2001/jw-0112-singleton.html&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-6621338860788165653?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/6621338860788165653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=6621338860788165653' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/6621338860788165653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/6621338860788165653'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/03/criticism-on-one-patterns-lesson-3.html' title='Criticism on one the Patterns (Blog 3)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-2257896098840947534</id><published>2007-02-22T16:27:00.000-08:00</published><updated>2007-03-28T15:24:53.629-07:00</updated><title type='text'>FAQs on Software Patterns (Blog 2)</title><content type='html'>&lt;div align="justify"&gt;&lt;strong&gt;1- Software patterns! Never heared of it, What are these?&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/strong&gt;Ans: Solution of the problems that occur during the development life cycle of any software with in the context is called Software Patterns.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2- Do patterns support software engineering?&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/strong&gt;Ans: In terms of reusing the solution of a particular problem of software architecture is supported by patterns which help in the development of the software.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3- What is the use of patterns in software engineering?&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/strong&gt;Ans: Patters are solutions to a problem in a context. In order to make the software work efficiently in terms of performance and making the software in such a way that can be reused, it is therefore useful to use patterns while developing the software.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4- Is it worth using Patterns during software development?&lt;/strong&gt;&lt;/div&gt;&lt;strong&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;/strong&gt;Ans: Using patterns during the software development could in a very good result. The solution of problems is dealt in an efficient way so that time is not wasted! Getting experience from the problems faced earlier can help in reoccurring problems.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5- How patterns benefit the developers?&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;Ans: Generally if we talk about patterns even in real life pattern plays a vital role in any kind of problem which is occurring. It allows us to apply proper phenomena to solve the problem which we are facing while doing anything.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;6-Is there any way that patterns give more than one solution to a problem?&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I don’t think so that giving alternatives solution to the problem would be a good option. Its better not to mention more than one solution to the problem. Each solution should be linked to the situation in which it best applies accordingly.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;u&gt;Thanks for reading,Please comment.&lt;/u&gt;&lt;/em&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-2257896098840947534?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/2257896098840947534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=2257896098840947534' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/2257896098840947534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/2257896098840947534'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/02/faqs-on-software-patterns-lesson-2.html' title='FAQs on Software Patterns (Blog 2)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8800808806135919345.post-2486489211344540479</id><published>2007-02-22T16:02:00.000-08:00</published><updated>2007-05-15T04:14:33.924-07:00</updated><title type='text'>Patterns (Blog 1)</title><content type='html'>&lt;div align="justify"&gt;After doing research on Patterns,I have come to the point that Patters are solutions to a problem in a context. In order to make the software work efficiently in terms of performance and making the software in such a way that can be reused, it is therefore useful to use patterns while developing the software.&lt;br /&gt;&lt;br /&gt;The main aim of patterns within the software linked people is to build a body to help software developers to solve the problems which are occurring concurrently during the software development. Patterns help us in creating a gateway which can communicate insight and get experience from the problems and their solution&lt;/div&gt;&lt;div align="justify"&gt;In more simple words I would say the pattern is a thing which occurs in the world and tells us the rule how to create that thing and where there is a need to create it.&lt;/div&gt;&lt;div align="justify"&gt;I found a very good quote by Albert Einstein which is a single line only but explains every thing about patterns. I would like to share it with every one&lt;br /&gt;&lt;br /&gt;"Example isn't another way to teach; it's the only way"&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;One of the simplest understandable real world examples of Pattern is a student who is giving an exam in college. The duration of the exam is one hour in which he/she has to attempt two questions out of three. Student knew the answer of the questions which were asked in the question paper but due to slow handwriting and understanding the questions couldn’t able to complete the two questions and wasted time. Therefore, he/she did attempt the exam but couldn’t finish it on time.&lt;br /&gt;&lt;strong&gt;Problem:&lt;/strong&gt; How to answer the questions on time?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Practice of writing fast before the exam should be done so that all the questions can be answered.&lt;br /&gt;Understanding the questions instead of getting confused.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Context:&lt;/strong&gt; Attempting exams properly within the time allocated in future so that the same problem doesn’t appear again.&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;u&gt;Thanks for reading,Please comment.&lt;/u&gt;&lt;/em&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;u&gt;&lt;/u&gt;&lt;/em&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;em&gt;&lt;u&gt;Reference&lt;/u&gt;&lt;/em&gt;&lt;/div&gt;&lt;div align="justify"&gt;Quote by Albert Einstein taken from URL&lt;/div&gt;&lt;div align="justify"&gt;&lt;a href="http://www-128.ibm.com/developerworks/webservices/library/ws-antipatterns/"&gt;http://www-128.ibm.com/developerworks/webservices/library/ws-antipatterns/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8800808806135919345-2486489211344540479?l=hanipatterns.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hanipatterns.blogspot.com/feeds/2486489211344540479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8800808806135919345&amp;postID=2486489211344540479' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/2486489211344540479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8800808806135919345/posts/default/2486489211344540479'/><link rel='alternate' type='text/html' href='http://hanipatterns.blogspot.com/2007/02/patterns-lesson-1.html' title='Patterns (Blog 1)'/><author><name>Hani</name><uri>http://www.blogger.com/profile/01638109066082126174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry></feed>
