<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>design-patterns &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/design-patterns/</link>
	<description>Feed of posts on WordPress.com tagged "design-patterns"</description>
	<pubDate>Tue, 01 Dec 2009 21:56:30 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Domain Driven Design : An Introduction]]></title>
<link>http://guptavikas.wordpress.com/2009/12/01/domain-driven-design-an-introduction/</link>
<pubDate>Tue, 01 Dec 2009 15:21:59 +0000</pubDate>
<dc:creator>Vikas Gupta</dc:creator>
<guid>http://guptavikas.wordpress.com/2009/12/01/domain-driven-design-an-introduction/</guid>
<description><![CDATA[Introduction The primary purpose of most software projects is to add value to the customer&#8217;s b]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction</strong></p>
<p><strong><span style="font-weight:normal;">The primary purpose of most software projects is to add value to the customer&#8217;s business. This is done by abstracting the complex web of thoughts inside a human mind in the form of a software program. Most software projects cater to a particular domain, and in many software projects, the domain of a software project is not technical. Unfortunately, majority of the technical people do not give enough importance to the domain of the software, and hence, they lack the required domain knowledge. This lack of domain knowledge leads to a situation where <strong>What</strong>(to do?) takes over <strong>Why</strong>(to do?). Generally, in such a scenario, it might be possible to deliver a usable product, but the primary purpose of adding business value is often neglected.</span></strong></p>
<p>The above mentioned situation is quite common and there is a continual influx of thoughts, which intend to provide a solution, by various experts. <a href="http://domaindrivendesign.org/about">Eric Evans</a> is one of such experts, who based on his experience, gained by working on complex projects, epitomized his findings in the form of tips, suggestions, patterns and guidelines, and coined a term <strong>Domain Driven Design</strong>, better known as <strong>DDD</strong>. In this blog, I intend to present various aspects of DDD and how it suggests to tackle the complexity of the domain.<br />
<!--more--><br />
<strong>What is DDD?</strong></p>
<p><strong><a href="http://guptavikas.wordpress.com/files/2009/12/picture_1000_words.jpg"><img class="aligncenter size-medium wp-image-113" title="picture_1000_words" src="http://guptavikas.wordpress.com/files/2009/12/picture_1000_words.jpg?w=300" alt="" width="300" height="300" /></a><br />
</strong></p>
<p>A picture is worth a thousand words and, sometimes, is better suited to convey a message. Similarly, a domain model is a simplification of the domain of the software and it abstracts the elements of domain which are relevant to the problem the software intends to solve. A domain model is representation agnostic, i.e., it can be represented as an UML diagram, as written code, as simply plain English, or as a simple diagram. The decision to choose an option depends upon the situation and complexity of the problem. The process of creating, maintaining and enhancing highly expressive domain model by applying objected oriented principles, design patterns is known as <strong>Domain Driven Design(DDD)</strong>. One important point to understand is that DDD is not a one time activity. It is an iterative process and model evolves with the project.</p>
<p>We all know that the process of creating domain model by abstracting from the complexities of a domain is not an easy job. Experienced programmers/thought leaders often compare this job with that of an artist. Few would disagree with them. But, with any art, there are certain principles and practices, which make the process of identifying and representing abstractions simpler. DDD also suggests to employ certain principles and practices, which we may already be doing intuitively, to work with highly expressive domain models. Let&#8217;s have a look at some of the principles and practices of DDD.</p>
<p><strong>Getting Started with DDD</strong><br />
There might be several questions, which may be taking shape in the mind right now. Let&#8217;s see which DDD principles and practices applies to specific question</p>
<p><strong>Q:</strong> I don&#8217;t have the domain knowledge. How will I communicate effectively with the domain experts?<br />
<strong>A:</strong> In most projects, there is an interface between the technical people and the domain experts. We may call this expert a Business Analyst, a Product Owner, or with some other name. Sometimes, this interface is not effective to transform the messages between two parties and in the process of message transformation, some relevant details are missed. This leads to a situation where <strong>WHAT</strong> takes over <strong>WHY</strong>.</p>
<p>To overcome this problem, DDD emphasizes to have a close relationship between the domain experts and the developers. Even when a modeler is working with domain experts(DE), he should be hands-on enough to think about design issues while brainstorming with the DE. DDD also suggests DDD developers to pick up key concepts while having conversation with the DE and also educate them about their terminology. This leads to the development of a <strong>Ubiquitous Language(UL)</strong> which forms the basis of development domain model. UL is basically a medium of communication which is used to develop a domain model. It is also used to validate a domain model periodically. The development of UL is an iterative process and is based on mutual agreement between DE and technical people.</p>
<p><strong>Q:</strong> How will I represent my domain model?<br />
<strong> A:</strong> Domain model should be represented in a way which best communicates the intent of the domain knowledge. It can be in the form of a diagram, a UML diagram, plain English, or simply code. Now, when there is freedom to represent something in multiple forms, how to maintain the sanctity of the domain model. I think that&#8217;s the job of the skilled developers or domain modelers. It is difficult to provide a rule for everything and we all know that real world is like that. Sometimes we have to break the rules and take pragmatic decisions. DDD realizes that and promotes developers to take pragmatic decisions instead of being bound by the rules.</p>
<p><strong>Q:</strong> How will I layout the architecture of the application with DDD?<br />
<strong> A:</strong> The focus of DDD is to create domain models that are rich in behavior. Typically, an application has several other issues as well which are not concerned with the domain. To work effectively with DDD, we need to isolate those issues from the domain modelling. In order to do so, we can use layered architecture to isolate and group the problems.</p>
<p><a href="http://guptavikas.wordpress.com/files/2009/12/layering.png"><img class="aligncenter size-full wp-image-99" title="layering" src="http://guptavikas.wordpress.com/files/2009/12/layering.png" alt="" width="371" height="209" /></a>In a layered architecture, each layer is aware of the layers below it. In general, a layer at the lower level cannot make calls to the layer above it.</p>
<p><strong>Q:</strong> How will I represent concepts in a domain model?<br />
<strong> A:</strong> Most concepts in domain can be classified into</p>
<ul>
<li>Something which has an identity: <strong>Entities</strong>. Entities, which are essentially objects, identified by an identity, which does not change. The identity can be a surrogate key or a composite key.</li>
<li>Something which has an important meaning in larger picture but does not have an identity of it&#8217;s own: <strong>Value Objects(VOs)</strong>. VOs represent meaningful concepts and abstracts the details of those concepts but does not have their own entity. For example, a phone number is one such thing, which represent certain information, but does not make any sense if not associated with a person, place, etc.</li>
<li>Something which relate various concepts with each other: <strong>Cardinality</strong>. Cardinality represents relationship between various entities. DDD advocates to have minimum cardinality between entities.</li>
<li>Behavior common to various concepts: <strong>Services</strong>. Services are components which provides behavior which is not specific any particular entity. These services are different from the application service, in that, they provide services to the domain layer and not callable from the application layer.</li>
</ul>
<p>Apart from the above, DDD also introduces the concept of <strong>Aggregates</strong>, which are essentially small group of related objects. Aggregates have a common root and act as an entry point for outer world to the constituents of the aggregate. This helps in managing the complex web of associations in a domain model.</p>
<p>Also, since in many cases, entities will be persisted and again constructed back, DDD advocates the use of <strong>Factories</strong> and <strong>Repositories</strong>. Factories are generally used to create complex objects and Repositories are used to reconstruct an already persisted object. Here, Factories is not something which refers to only Factory pattern. We are free to choose from Factory, Builder or any other that we are aware of based on our judgement and something which conforms to <strong>UL</strong>.</p>
<p><strong>Q:</strong> How will I model behavior in domain model?<br />
<strong> A: </strong>In domain modelling, majorly, we have following kinds of behavior</p>
<ul>
<li>One which validates the domain model against certain rules: Specification Pattern. Specification pattern is employed to validate domain model against certain rule. For example, The logic to check whether the project is overdue can be put in the Project object, as in the following listing</li>
<pre class="brush: java;">
class Project {
  public boolean isOverdue() { … }
}
</pre>
<p>or, it can be abstracted as a Specification, as shown in the following code</p>
<pre class="brush: java;">
public interface ProjectSpecification {
  public boolean isSatisfiedBy(Project p);
}
public class ProjectIsOverdueSpecification implements ProjectSpecification {
  public boolean isSatisfiedBy(Project p) { … }
}
If (projectIsOverdueSpecification.isSatisfiedBy(theCurrentProject) { … }
</pre>
<li>One which is algorithmic in nature, like calculations, rules: Strategy/Policy Pattern. Strategy pattern is essentially employed to abstract out algorithms or business rules out of domain model. For example, if there is a business rule to allow Voyage overloading with 10% overloading. Then, without strategy pattern, code might look like
<pre class="brush: java;">
 public int makeBooking(Cargo cargo, Voyage voyage) {
   double maxBooking = voyage.capacity() * 1.1;
   if ((voyage.bookedCargoSize() + cargo.size()) &#62; maxBooking)
       return –1;
   int confirmation = orderConfirmationSequence.next();
   voyage.addCargo(cargo, confirmation);
   return confirmation;
}
        </pre>
<p>After applying Strategy pattern, the code might look like</p>
<pre class="brush: java;">
public int makeBooking(Cargo cargo, Voyage voyage) {
if (!overbookingPolicy.isAllowed(cargo, voyage)) return –1;
   int confirmation = orderConfirmationSequence.next();
   voyage.addCargo(cargo, confirmation);
   return confirmation;
}

public OverBookingPolicy {
public boolean isAllowed(Cargo cargo, Voyage voyage) {
   return (cargo.size() + voyage.bookedCargoSize()) &#60;=
         (voyage.capacity() * 1.1);
}
}
        </pre>
<p>This helps in making code/model more expressive and flexible.</li>
</ul>
<p><strong>Q:</strong> How will I maintain the integrity of the model in a large team with complex domain?<br />
<strong> A: </strong>While working on large projects and large teams, it is difficult to express the intent of the domain with a single model. DDD advocates the use separate models to model the entire system. The patterns to handle the complexity of working with separate models and communicating between them are grouped as <strong>Strategic Design Patterns</strong> in DDD. Various strategic design patterns are their relationships are shown in the following diagram.</p>
<p><a href="http://guptavikas.wordpress.com/files/2009/12/strategic_design1.png"><img class="aligncenter size-full wp-image-124" title="strategic_design1" src="http://guptavikas.wordpress.com/files/2009/12/strategic_design1.png" alt="" width="376" height="255" /></a></p>
<ul>
<li><strong>Bounded Context:</strong> DDD suggests to separate multiple domain models based on contexts. For example, in above figure domain model expressing project model is bound by project context, where as, billing model is bound by billing context. Contexts are generally created based on team structure and domain concepts.</li>
<li><strong>Context Maps:</strong> Different models in an application cannot work in isolation. There will be some data sharing among them. DDD provides some patterns based on experience. Theses pattens have specific applicability which are explained below.
<ul>
<li><strong>Shared Kernel:</strong> In this pattern, another domain model is created which models the shared data. For example, in the above example, shared data can be Customer and that would be part of Shared Kernel.</li>
<li><strong>Customer/Supplier:</strong> This pattern is applied when one context has dependency on another pattern. In this scenario, customers models can discuss their concerns with suppliers and raise their concerns and get the supplier model modified.</li>
<li><strong>Conformist:</strong> This pattern is similar to above pattern but customer model has no control over supplier model and customers are forced to deal with whatever suppliers dish out.</li>
<li><strong>Anti Corruption(AC) Layer: </strong>When the supplier model is third party and legacy code, there is high probability that the legacy code is developed not using domain modelling techniques. There might be chance of theses bad practices to creep into your own domain model. To insulate your domain model, DDD advocates the use of an AC layer, which is essentially a collection of services and adapters which translate the communication between the two models.</li>
<li><strong>Separate Ways:</strong> When the cost of integration between various model becomes overwhelming, we can decide not to integrate them at all. Instead, we can decide to break the application into smaller application which have little or nothing in common from modeling perspective.</li>
</ul>
</li>
</ul>
<p><strong>Q:</strong> How do I learn more about DDD?<br />
<strong> A:</strong> To get started with DDD, I recommend following approach</p>
<ol>
<li>Download <a href="http://www.infoq.com/minibooks/domain-driven-design-quickly">Domain Driven Design Quickly</a>, a brief and concise guide about DDD from InfoQ to get started.</li>
<li>Go through, <a href="http://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215">Domain-Driven Design: Tackling Complexity in the Heart of Software</a> by Eric Evans.</li>
<li>You can also join <a href="http://groups.yahoo.com/phrase/domain-driven-design">Domain driven design group on Yahoo</a> to get connected with the latest in DDD.</li>
</ol>
<p><strong>Conclusion</strong><br />
<strong><span style="font-weight:normal;">In this blog, we discussed about what is DDD and looked at the various pattens suggested by DDD. DDD is not only object orientation done right but also understanding the domain of the application. DDD does not lay down any rules and only suggests to do certain things, which have worked on various projects. Any developer can benefit from it because it is merely a thought process which has evolved based on experience and not is not a figment of anyone&#8217;s imagination. DDD, along with </span><span style="font-weight:normal;">Agile</span><span style="font-weight:normal;"> practices like </span><span style="font-weight:normal;">TDD, Continuous Integration and Refactoring</span><span style="font-weight:normal;">, is a potent weapon in any designer&#8217;s armor.</span></strong></p>
<p>As promising it may be, DDD&#8217;s applicability has major challenges. Based on my experience in IT industry, I have summarized majority of them below:</p>
<ul>
<li>Poor quality of requirements: As already discussed in the blog, most projects have a translation layer which translates the requirements between business and technical people. Some may call them Business Analysts, whereas some call them Product Owner. So, quality of communication, and hence the requirements, depend upon this translation layer. On top of that, if this translation layer is bureaucratic, they would not like developers to work directly with the business as it would dilute their role in the project. So, apart from skills, DDD requires people with right mindset at the top and the team.</li>
<li>Simple Domain: The application/domain may be simple enough to yield any significant ROI of using DDD. The effect of DDD might be visible once the project becomes complex.</li>
<li>Motivation: DDD is all about making pragmatic decisions and it requires a lot of skill, but more importantly, a lot of motivation to make those decisions.</li>
</ul>
<p>In summary, DDD is a promising concept, which is gaining momentum in recent years. Although, it may not be applicable to every project directly, but learning these principles would certainly enhance design skills of a developer.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[design patterns / Architectural Patterns / UX patterns]]></title>
<link>http://dotnettrails.wordpress.com/2009/12/01/design-patterns-architectural-patterns-ux-patterns/</link>
<pubDate>Tue, 01 Dec 2009 05:00:23 +0000</pubDate>
<dc:creator>dotnettrails</dc:creator>
<guid>http://dotnettrails.wordpress.com/2009/12/01/design-patterns-architectural-patterns-ux-patterns/</guid>
<description><![CDATA[One of my colleague asked me if I can share some resources on patterns. That got me thinking what to]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p align="left">One of my colleague asked me if I can share some resources on patterns. That got me thinking what to share! Then in casual talk I just shared him some links. But then there was nothing about MVC or MVP or MVVM or any UX patterns. I thought that should be more organized. So here it is. There are </p>
<ul>
<li>
<div align="left">Design Patterns</div>
</li>
<li>
<div align="left">Architectural Patterns</div>
</li>
<li>
<div align="left">UX Patterns</div>
</li>
</ul>
<p align="left"><strong></strong></p>
<p align="left"><strong>Design Patterns</strong></p>
<p align="left">&#160;</p>
<p align="left">Design patterns as we know of from the Gang of Four are pretty old [very relevant too] and every now and them evolved versions of these basic design patterns have emerged.</p>
<p align="left">The extended list is available in Wikipedia at <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)">http://en.wikipedia.org/wiki/Design_pattern_(computer_science)</a>&#160;</p>
<p align="left">Also check out the best resource on web on Design patterns with examples and explanation at <a href="http://www.dofactory.com/Patterns/Patterns.aspx">http://www.dofactory.com/Patterns/Patterns.aspx</a></p>
<p align="left">&#160;</p>
<p align="left"><strong>Architectural Patterns </strong></p>
<p align="left">&#160;</p>
<p align="left">Then there are Architectural Design Patterns also detailed in Wikipedia at <a href="http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)">http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)</a> which offer well-established solutions to architectural problems in software engineering. I would like to add MVP and MVVM to the list. Easy to understand explanation of MVC, MVP and MVVM can be found at <a href="http://nirajrules.wordpress.com/2009/07/18/mvc-vs-mvp-vs-mvvm/">http://nirajrules.wordpress.com/2009/07/18/mvc-vs-mvp-vs-mvvm/</a></p>
<p align="left">&#160;</p>
<p align="left"><strong>UX Patterns</strong></p>
<p align="left"><strong></strong></p>
<p align="left">Apart from the Design/Architectural patterns, there is a User experience patterns. Infragistics has nicely put a list of 91 UX patterns that are clubbed by user tasks, tag relations, and by wireframe. Find all of them at&#160; Quince <a title="http://quince.infragistics.com/" href="http://quince.infragistics.com/">http://quince.infragistics.com/</a></p>
<p align="left">&#160;</p>
<p align="left">There are some <a href="http://codingpatterns.blogspot.com/" target="_blank">coding patterns</a> blog by <a href="http://www.blogger.com/profile/16926123100967129905" target="_blank">GABE MOOTHART</a>. May be he can come up with proper list/table of contents for all the patterns he is talking about.</p>
<p align="left">&#160;</p>
<p align="left">If I have missed out comment.. I will update the post!</p>
<p align="left">&#160;</p>
<p align="left">&#160;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:80cbf8cd-fba3-4989-9e6c-4d7e520ec227" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/Design+Patterns" rel="tag">Design Patterns</a>,<a href="http://technorati.com/tags/Architectural+Patterns" rel="tag">Architectural Patterns</a>,<a href="http://technorati.com/tags/UX+Patterns" rel="tag">UX Patterns</a>,<a href="http://technorati.com/tags/MVC" rel="tag">MVC</a>,<a href="http://technorati.com/tags/MVP" rel="tag">MVP</a>,<a href="http://technorati.com/tags/MVVM" rel="tag">MVVM</a>,<a href="http://technorati.com/tags/Gang+of+Four" rel="tag">Gang of Four</a>,<a href="http://technorati.com/tags/Do+Factory" rel="tag">Do Factory</a>,<a href="http://technorati.com/tags/Wikipedia" rel="tag">Wikipedia</a>,<a href="http://technorati.com/tags/Niraj" rel="tag">Niraj</a>,<a href="http://technorati.com/tags/Infragisitics" rel="tag">Infragisitics</a>,<a href="http://technorati.com/tags/Quince" rel="tag">Quince</a>,<a href="http://technorati.com/tags/Resources" rel="tag">Resources</a></div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[JAXB and ObservableList]]></title>
<link>http://javathought.wordpress.com/2009/11/30/jaxb-and-observablelist/</link>
<pubDate>Mon, 30 Nov 2009 17:23:01 +0000</pubDate>
<dc:creator>Pascal</dc:creator>
<guid>http://javathought.wordpress.com/2009/11/30/jaxb-and-observablelist/</guid>
<description><![CDATA[If you don&#8217;t customize your schemas with JAXB, your generated classes will not handle correctl]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>If you don&#8217;t customize your schemas with JAXB, your generated classes will not handle correctly the list in your UI (using beans binding functionnality).</p>
<p>If you have lists in your xml, you&#8217;ll probably handle them with Jtable or JList in your UI. Modifications of objects (from the edition form if you don&#8217;t edit directly in your list) will be seen in your table, but creation or deletion of an element in the list will not be seen. To see creation or deletion events in your UI lists, your object list have to be observable, i.e. implements ObservableList.</p>
<p>JAXB generate the following code for xml lists :</p>
<pre class="brush: java;">
protected List&#60;E&#62; listElements = new ArrayList&#60;E&#62;();
</pre>
<p>The way to create an an observable list is below; beans binding library contains a factory :</p>
<pre class="brush: java;">
org.jdesktop.observablecollections.ObservableCollections.observableList(new ArrayList&#60;E&#62;());
</pre>
<p>I would appreciate a way to modify the creation method in JAXB, but didn&#8217;t find it. So I created a class which implements the ObservableList interface (with an almost Decorator Pattern) and specify to JAXB to use this class to handle lists :</p>
<p>So, first step, create your own class for lists, that implements all method of ObservableList :</p>
<pre class="brush: java;">
package my.package;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import org.jdesktop.observablecollections.ObservableCollections;
import org.jdesktop.observablecollections.ObservableList;
import org.jdesktop.observablecollections.ObservableListListener;

public class MyObservableList&#60;E&#62; implements
		ObservableList&#60;E&#62; {

	private ObservableList&#60;E&#62; l= ObservableCollections.observableList(new ArrayList&#60;E&#62;());

	public AdretObservableList() {

	}

	public void addObservableListListener(ObservableListListener arg0) {
		l.addObservableListListener(arg0);
	}

	public void removeObservableListListener(ObservableListListener arg0) {
		l.removeObservableListListener(arg0);
	}

//... and so one for all methods
}
</pre>
<p>Then specify xjc to use a custom bindings settings. Use -b file.xjb, the file containing the following instructions :</p>
<pre class="brush: xml;">
&#60;bindings xmlns=&#34;http://java.sun.com/xml/ns/jaxb&#34; version=&#34;2.0&#34; xmlns:xs=&#34;http://www.w3.org/2001/XMLSchema&#34;&#62;

  &#60;globalBindings
  collectionType=&#34;my.package.MyObservableList&#34; &#62;
  &#60;/globalBindings&#62;

&#60;/bindings&#62;
</pre>
<p>This way, JAXB will call</p>
<pre class="brush: java;">
protected List&#60;E&#62; listElements = new MyObservableList&#60;E&#62;();
</pre>
<p>The <a href="http://www.no0ne.org/">plugin from no0ne</a> handle this UI requirement (with the library CollectionBeanProperty).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Creational Patterns]]></title>
<link>http://poyblog.wordpress.com/2009/11/29/creational-patterns/</link>
<pubDate>Sun, 29 Nov 2009 21:48:14 +0000</pubDate>
<dc:creator>poyblog</dc:creator>
<guid>http://poyblog.wordpress.com/2009/11/29/creational-patterns/</guid>
<description><![CDATA[Inizieranno ora una serie di articoli specifici sui Pattern di tipo Creational, in particolare anali]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Inizieranno ora una serie di articoli specifici sui Pattern di tipo Creational, in particolare analizzeremo:</p>
<ul>
<li>Abstract Factory</li>
<li>Builder</li>
<li>Factory Method</li>
<li>Prototype</li>
<li>Singleton</li>
</ul>
<p>Prima di entrare nella analisi approfondita di questi strumenti è utile volgere uno sguardo d&#8217;insieme verso l&#8217;ambito di applicazione degli stessi.</p>
<p>I Pattern di tipo creational astraggono il processo di instanziazione, in sostanza aiutano a creare un sistema indipendente rispetto a come gli oggetti che lo compongono vengono creati, composti e rappresentati.</p>
<p>Questa categoria di pattern diviene fondamentale durante la fase di evoluzione del sistema nel caso in cui questo dipenda più dalla composizione degli oggetti che dalla ereditarietà delle classi.<!--more--></p>
<p>Esistono due temi ricorrenti in questi pattern:</p>
<ol>
<li>incapsulano tutta la conoscenza all&#8217;interno di classi 	concerete che il sistema utilizza</li>
<li>nascondono come le istanze delle classi vengono 	generate</li>
</ol>
<p>Durante l&#8217;analisi dei pattern Creazionali analizzeremo un problema concreto lato applicativo, ovvero la costruzione di un labirinto per un videogioco.</p>
<p>Le caratteristiche principali dell&#8217;applicazione saranno:</p>
<ul>
<li>Stanze (Room)</li>
<li>Muri (Wall)</li>
<li>Porte (Door)</li>
</ul>
<p>Tutte classi che descrivono le medesime strutture</p>
<p>In più avremo la presenza della classe MapSite, una classe astratta che gestisce tutti i componenti di un labirinto (Room, Wall, Door) e la classe Maze che rappresenta una collezione di stanze.</p>
<p>Esiste una classe ulteriore MazeGame che avrà il compito di creare il labirinto, in particolare genererà:</p>
<ul>
<li>Labirnito</li>
<li>stanze</li>
<li>porte di comunicazione fra stanze</li>
<li>etc&#8230;</li>
</ul>
<p>Esaminiamo ora a grandi linee come l&#8217;utilizzo dei Design Pattern di tipo creazionale ci può aiutare nella progettazione di questo videogioco.</p>
<p>Innanzitutto è utile sottolineare che i pattern di questa sezione non servono a rendere la struttura più semplice, ma più <strong>flessibile</strong>, ovvero render più semplice il cambiamento delle classi che definiscono la struttura del  un labirinto.</p>
<p>I dettagli:</p>
<ul>
<li>Se 	la classe <em>CreateMaze</em> utilizzasse delle funzioni virtuali per creare stanze, muri e porte 	invece di utilizzare dei costruttori, allora si potrebbero 	modificare le stesse classi perchè vengano instanziate creando una 	sottoclasse (<em>MazeGame</em>) 	 che ne ridefinisca le funzioni. Questo è un esempio di<strong> Factory Method</strong></li>
<li>Se 	<em>CreateMaze </em>passasse 	un oggetto come parametro utilizzabile per la creazione di stanze, 	muri e porte, allora sarebbe possibile cambiare il comportamento 	delle classi che definiscono porte, muri e stanze semplicemente 	passandogli parametri differenti. <strong>Absreact 	Factory</strong></li>
<li>Se 	<em>CreateMaze </em>passasse 	un oggetto come parametro utilizzabile per creare un nuovo labirinto 	nella sua interezza, utilizzando le operazioni per aggiungere muri, 	porte e stanze, allora si potrebbe utilizzare l&#8217;ereditarietà per 	modificare una parte del labirinto o il modo in cui questo viene 	costruito. <strong>Builder</strong></li>
<li>Se<em> CreateMaze </em>fosse 	parametrizzato da vari prototipi di stanze, porte e muri, i quali si 	accopiano e si aggiungono al labirinto stesso, sarebbe possibile cambiare 	la composizione del labirinto cambiando questi prototipi con altri. 	<strong>Prototype</strong></li>
<li><strong>Singleton </strong>protebbe 	assicurare che solo un labirinto per gioco sia accessibile, e così 	anche per tutti gli altri oggetti che compongono il gioco, senza 	fare riferiemnto a variabili o funzioni globali.</li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[SLODUG Meeting]]></title>
<link>http://arkcore.wordpress.com/2009/11/26/slodug-meeting/</link>
<pubDate>Thu, 26 Nov 2009 20:48:38 +0000</pubDate>
<dc:creator>Danijel Malik</dc:creator>
<guid>http://arkcore.wordpress.com/2009/11/26/slodug-meeting/</guid>
<description><![CDATA[Today I’m just enough in the mood to write some stuff…wish this mood would last for a few more days ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Today I’m just enough in the mood to write some stuff…wish this mood would last for a few more days <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Ok. What’s this time? I forgot to mention I’ll be speaking at SLODUG meeting at Wednesday 3.12.2009 too. This session we’ll cover:</p>
<p>MVVM:</p>
<ul>
<li>What is MVVM </li>
<li>How we use it </li>
<li>Pros &#38; cons </li>
</ul>
<p>WPF Composite</p>
<ul>
<li>Framework presentation </li>
<li>UI Composition </li>
<li>Modularity </li>
<li>Commanding </li>
<li>Eventing </li>
<li>Pros &#38; cons </li>
</ul>
<p>Hope you join us!</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[WebCamp]]></title>
<link>http://arkcore.wordpress.com/2009/11/26/webcamp/</link>
<pubDate>Thu, 26 Nov 2009 20:33:43 +0000</pubDate>
<dc:creator>Danijel Malik</dc:creator>
<guid>http://arkcore.wordpress.com/2009/11/26/webcamp/</guid>
<description><![CDATA[Hi, I’m pretty sure all of you know the famous WebCamp. If you don’t, go ahead and inform yourself o]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi,</p>
<p>I’m pretty sure all of you know the famous WebCamp. If you don’t, go ahead and inform yourself on the link below.</p>
<p><a href="http://webcamp.si/">WebCamp</a></p>
<p>Notifying you that the WebCamp we’ll get underway at Saturday 28.11.2009 is little to late…but if you’ll be there, make sure you don’t miss my presentation <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>SL: “<strong>Chaos vs Order – uporabimo MVVM v WPF &#38; Silverlight aplikacijah</strong>”     <br />EN: “<strong>Chaos vs Order – use MVVM in WPF &#38; Silverlight applications</strong>”</p>
<p>That’s it <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Pervasive Computing + Architecure = ?]]></title>
<link>http://breadthfirst.wordpress.com/2009/11/25/pervasive-computing-architecure/</link>
<pubDate>Wed, 25 Nov 2009 17:55:27 +0000</pubDate>
<dc:creator>Dan</dc:creator>
<guid>http://breadthfirst.wordpress.com/2009/11/25/pervasive-computing-architecure/</guid>
<description><![CDATA[There was an interesting side discussion about the level of control over things like lighting that y]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>There was an interesting side discussion about the level of control over things like lighting that you might want in an &#8220;intelligent environment&#8221; at <a href="http://sethholloway.com/blog/2009/11/11/thats-phd-candidate-seth-holloway-to-you/">Seth&#8217;s proposal</a>. </p>
<p>That was already off topic, and I didn&#8217;t want to derail the conversation even further, but it reminded me of the chapter in the original design patterns book* where Chris points out that it&#8217;s good to have windows on three sides of a room to avoid harsh contrasts between light and dark. That&#8217;s one way to do it, but it&#8217;s hard (and expensive) to design a building to meet that constraint, if you want to have natural light in every room; it wouldn&#8217;t be hard to have embedded sensors and adjustable lighting fix the problem, though. </p>
<p>What other architectural design patterns can be worked around with a bit of cheap technology? I see a lot of modernist architecture that takes advantage of advances in materials science to create interesting looking structures that would have been impossible centuries ago, and I see some of what I think of as Jane Jacobs style patterns, where classical ideas are used to create comfortable spaces that people actually want to use, but I don&#8217;t see much use of cutting edge technology to create really livable space. Why is that, and what can we do about it?</p>
<p>*Christopher Alexendar&#8217;s A Pattern Language, not the GoF Design Patterns book <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[WPF: Replicating MDI Application Behaviour]]></title>
<link>http://waxtadpole.wordpress.com/2009/11/25/wpf-replicating-mdi-application-behaviour/</link>
<pubDate>Wed, 25 Nov 2009 06:36:58 +0000</pubDate>
<dc:creator>baraholka1</dc:creator>
<guid>http://waxtadpole.wordpress.com/2009/11/25/wpf-replicating-mdi-application-behaviour/</guid>
<description><![CDATA[I decided to use Prism, aka Microsoft Composite Application Guidance For WPF and Silverlight. This i]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I decided to use <strong>Prism,</strong> aka Microsoft<a href="http://msdn.microsoft.com/en-us/library/dd458809.aspx"> Composite Application Guidance For WPF and Silverlight.</a></p>
<p>This is very much like using a supersonic jet fighter to pop down to the local shops but its effective, not very hard and does not require you to write reams of fragile custom code. You just need to spend a bit of time getting used to Prism. Now that&#8217;s not a <em>trivial </em>task, but you should have covered the fundamental concepts within a working week, assuming you have some prior knowledge of Dependency Injection.</p>
<p>The huge advantage to you is that Prism is written by people who are much better programmers than you or I are, so the code is robust, whereas writing a custom MDI Window Manager is out of the league of most Intermediate-level developers (most of us).</p>
<p>Very simply, Prism allows the development of <i>Modular Applications </i> in which the User Interface of an application is decomposed into loosely-coupled <em>Modules</em>, each of which occupies a specific area on the screen, known as a <em>Region.</em></p>
<p>No window (known in Prism as a <em>View</em>) can move outside the <em>Region</em> in which it is contained. This replicates the MDI-like behaviour you&#8217;re looking for.</p>
<p>Prism is also a library of <em>Best Practices</em> &#8211; it&#8217;s produced by the <a href="http://msdn.microsoft.com/en-us/default.aspx">Microsoft Patterns and Practices</a> team &#8211; so you get heaps of built-ins for free. And <a href="http://www.codeplex.com/CompositeWPF/Thread/List.aspx">there&#8217;s a helpful forum </a>where others using Prism are happy to help us newbies.</p>
<p>You can also have multiple windows (views) open simultaneously if you want, but this will render as a tabbed interface which is not exactly the same as MDI.</p>
<p>I embarked upon this approach and have been successful in producing a MDI-like app. It wasn&#8217;t too hard and I learnt heaps along the way. Go for it.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[MEF in MVVM]]></title>
<link>http://maonet.wordpress.com/2009/11/24/mef-in-mvvm-with-wcf/</link>
<pubDate>Tue, 24 Nov 2009 18:24:24 +0000</pubDate>
<dc:creator>Frank Mao</dc:creator>
<guid>http://maonet.wordpress.com/2009/11/24/mef-in-mvvm-with-wcf/</guid>
<description><![CDATA[I read a post about MEF vs. IOC which cleared the confusion: MEF should be used external of app, whi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I read a post about <a href="http://mef.codeplex.com/">MEF</a> vs. IOC which cleared the confusion: MEF should be used external of app, while IOC should be used internally.</p>
<p>Good point. I have been struggling with how to separate my view and view model correctly in WPF app for a long time.   In fact Bil Simer already suggested that MEF is perfect fit in MVVM/Presentation Model last year during the Edmonton Code Camp 2008.</p>
<p>Ideally, all view models can be compiled into a separated assembly and put into specific folder to be imported by UI views!</p>
<p>Some code changes during my code conversion include:</p>
<ul>
<li>Remove ctor args from view model, I haven&#8217;t figure out how to feed ctor args when MEF importing. This is not easy as auto-wiring in IOC. I ended up with a separate initialize method in each view model, which is not too bad, because I have to call wireUpViewModel from view anyway, this Initialize method has a perfect place to put.</li>
<li>I&#8217;m still not sure where should I put Container.Compose() method, because this method needs the instance the object to be imported into, I think compose as needed is better for WPF app.</li>
<li>Shared mode is the default behavior for export and import, it messed up my event handling code, (true, I didn&#8217;t do -= before +=). I had to explicitly add this everywhere.</li>
</ul>
<blockquote>
<pre>[Export]
[PartCreationPolicy(CreationPolicy.NonShared)]
or
[Import(typeof(NewRequestTypeViewModel), RequiredCreationPolicy = CreationPolicy.NonShared)]</pre>
</blockquote>
<p>Code:</p>
<pre class="brush: csharp;">
    public partial class TemplateEditShell : Window{

        private CompositionContainer _mefContainer;

        public TemplateEditShell()
        {
            InitializeComponent();
            InitialzieMEF();
        }

        private void InitialzieMEF()
        {
            var catalog = new AssemblyCatalog(System.Reflection.Assembly.GetExecutingAssembly());
            _mefContainer = new CompositionContainer(catalog);
        }

        private void btnEditItemList_Click(object sender, RoutedEventArgs e)
        {
            var proxy = ObjectFactory.GetInstance&#60;IRequestManagementAdminService&#62;();
            var view = new EditRequestTypeItemListView(_viewModel.SelectedRequestType, proxy);
            _mefContainer.ComposeParts(view);
            view.WireUpViewModel();
            view.ShowDialog();
        }
  }

    public partial class EditRequestTypeItemListView : Window
    {
        private readonly RequestTypeDto _requestTypeDto;
        private readonly IRequestManagementAdminService _proxy;

        [Import]
        public IEditRequestTypeItemListViewModel EditRequestTypeItemListViewModel { get; set; }

        public EditRequestTypeItemListView(RequestTypeDto requestTypeDto, IRequestManagementAdminservice proxy)
        {
            _requestTypeDto = requestTypeDto;
            _proxy = proxy;
            InitializeComponent();

            // Can't wire up in ctor, coz MEF import hasn't start/finish yet.
//            WireUpViewModel();
        }

        public void WireUpViewModel()
        {
            DataContext = EditRequestTypeItemListViewModel;

            EditRequestTypeItemListViewModel.Initialize(_proxy, _requestTypeDto);

            EditRequestTypeItemListViewModel.RequestShowMessage += (o, arg) =&#62; MessageBox.Show(arg.EventData);

        }
    }

    [Export(typeof(IEditRequestTypeItemListViewModel))]
    public class EditRequestTypeItemListViewModel : ViewModelBase, IEditRequestTypeItemListViewModel
    {
        private IRequestManagementAdminContract _proxy;
        private RequestTypeDto _currentRequestType;

        public RequestTypeItemDto SelectedRequestTypeItem { get; set; }

        public ObservableCollection ItemList { get; set; }

        public EditRequestTypeItemListViewModel()
        {
        }

        public void Initialize(IRequestManagementAdminContract proxy, RequestTypeDto currentRequestType)
        {
            _proxy = proxy;
            _currentRequestType = currentRequestType;

            ItemList = new ObservableCollection(proxy.FindAllRequestTypeItems(currentRequestType.Id));

            SelectedRequestTypeItem = ItemList.FirstOrDefault();
        }
  }
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Organizing Domain Logic]]></title>
<link>http://guptavikas.wordpress.com/2009/11/24/organizing-domain-logic/</link>
<pubDate>Tue, 24 Nov 2009 17:07:48 +0000</pubDate>
<dc:creator>Vikas Gupta</dc:creator>
<guid>http://guptavikas.wordpress.com/2009/11/24/organizing-domain-logic/</guid>
<description><![CDATA[Introduction Most enterprise applications use Layering as the primary technique to break the complex]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Introduction</strong></p>
<p>Most enterprise applications use Layering as the primary technique to break the complexity of the software projects. Layering involves breaking down the applications in various layers where each layer lie above the other and provide services to the higher layer. Layering provides following benefits</p>
<ul>
<li>You can understand about a layer without knowing about other layers. For example, if you know how <a href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol">TCP</a> works you can create your own <a href="http://en.wikipedia.org/wiki/File_Transfer_Protocol">FTP</a> service without actually knowing about the internals of the ethernet.</li>
<li>It is easy to substitute the layers with alternative implementation. For example, if DAO layer is designed properly, if should be easy to change the ORM solution from <a href="https://www.hibernate.org/">Hibernate</a> to <a href="http://ibatis.apache.org/">iBatis</a> easily.</li>
<li>Layering also helps in standardization and extensibility.</li>
</ul>
<p>But the downsides of layering applications include cascading changes, performance overhead of converting data from one representation into another and it is not often easy to decide the later of a particular component. Considering the benefits of layering and it&#8217;s applicability to almost any sort of computer application, it is used widely and successfully.</p>
<p>Three primary layers of an enterprise application can broadly be categorized into</p>
<ol>
<li>Presentation Layer: Information display, HTTP requests, command line invocations, batch API, etc.</li>
<li>Domain Layer: Here lies the &#8220;Heart of the software&#8221;</li>
<li>Datasource Layer: Provides access to external resources like databases, messaging, mail server, etc.</li>
</ol>
<p>In this blog, we will discuss various patterns of organizing domain logic and specific pros and cons of each. We will also discuss how these approaches compare with each other.<br />
<!--more--><br />
<strong>Domain Login Patterns</strong><br />
In his book, <a href="http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420">PoEEA</a>, <a href="http://martinfowler.com/">Martin Fowler</a> has classified domain logic patterns into three primary patterns: Transaction Script, Domain Model and Table Module. He also discussed introducing an additional layer, Service Layer, which is useful in providing horizontal services. Let&#8217;s look at each of these in detail.</p>
<p><strong>Transaction Script (TS)</strong><br />
Transaction script is essentially a procedure that takes input from the presentation, processes it with validations and calculations, stores data in the database, send emails, etc. It may also fetch the data and send to the UI. It&#8217;s more like coding a C program in Java. Typically, in transaction script method of organizing domain logic, the code is segregated into various services and each service has methods that perform a particular business functionality. A method of a transaction service might look like this</p>
<pre class="brush: java;">void tsmethod(params) {
   // get data
   // process data
   if () {
   } else if {
   } else {
   }
   // insert/update/delete data
   //send email
}</pre>
<p>As you can see from the above, most of the of the above code is procedural. Here, the services act on the entities. A typical example would be an interaction between session bean and entity bean. Another similar pattern not mentioned in the PoEEA is <a href="http://martinfowler.com/bliki/AnemicDomainModel.html">Anemic Domain Model</a> (ADM) which works on the same principle where domain objects have attributes and relationships but does not have behaviour. Behaviour is provided by the services. The different between TS and ADM is that in former we do not have domain objects but rather have something which Fowler describe as <a href="http://martinfowler.com/eaaCatalog/tableDataGateway.html">Table Data Gateway</a>, which essentially is a wrapper for SQL queries.</p>
<p><strong>Domain Model (DM)</strong><br />
In domain model approach, both behaviour and data are encapsulated inside the domain objects. Domain model looks different from the database design and utilizes inheritance, strategies, and other design patterns to create complex webs of small interconnected objects. A typical domain model code might look like</p>
<pre class="brush: java;">class Bar {
  private BarAdmissionPolicy = new BarAdmissionPolicy();
  public void admit(Person person) {
     if (BarAdmissionPolicy.isAllowed(person)) {
         this.add(person)
     }
  }
}
public class BarAdmissionPolicy {
   public boolean isAllowed(Person person) {
     if (person.age &#62; 18) {
        return true;
     }
     return false;
   }
}</pre>
<p>A well designed domain model provides an abstraction of the domain logic. It encapsulates complex business logic as interactions between domain objects.</p>
<p><strong>Table Module (TM)</strong><br />
It is essentially a singleton instance that handles the business logic for all the rows in a database table. There is no concept of identity in a Table Module. It is designed to operate on entire table data. A typical domain might look like</p>
<pre class="brush: java;">class Product {
 void insert(name, type, etc) {
 }
 void insertAll(List) {
 }
 void calculateProductCost(List productIds) {
 }
}</pre>
<p>As you can see, a table module encapsulates the data and behaviour of the entire table. It is most commonly used in places where UI widgets are data-aware like Oracle Forms or .Net environment which has Visual Studio, which provides tools like <a href="http://en.wikipedia.org/wiki/Recordset">RecordSet</a>.</p>
<p><strong>Service Layer (SL)</strong><br />
A Service Layer defines an application&#8217;s boundary and its set of available operations from the perspective of interfacing client layers. It encapsulates the application&#8217;s business logic, controlling transactions, applying security and coordinating responses in the implementation of its operations. Service Layer can be thick or thin depending upon whether you are using transaction scripts or domain model.</p>
<p>Now, we have understanding of the various domain logic patterns, let&#8217;s discuss how they compare with each other.</p>
<p><strong>Comparison</strong><br />
Essentially, if you are using one of DM, TM or ADM pattern, the domain layer can be split into two layers: SL + DM/TM/ADM. SL is essential in providing horizontal services like security, transactions, etc. With TS in practice, it is difficult to identify the difference between SL and TS since TS can double up as a SL also.</p>
<p>Since, TM emphasizes one class per table, there are issues in implementing OO concepts while inheritance. There are no direct relationships between objects. For example, if you want to get a List of Products and Categories separately then it is easy to define where to put the code, but it is not clear where to put the code if you need a RecordSet which contains both Products and Categories.</p>
<p>TS is more like a service class which makes implementing domain logic difficult when the complexity of the application increases, but works well for simple applications.</p>
<p>There is a tough competition between ADM and DM. DM is essentially a Rich Domain Model (RDM). Common things between them includes data and relationships. But things specific to RDM is behaviour of the domain model. There has been a heated debate between designers to prove the dominance of one over the other. Suprisingly, the wiki page for ADM lists why should be avoid them. I reiterate them here</p>
<ul>
<li> Logic cannot be implemented in a truly object-oriented way unless wrappers are used, which hide the anemic data structure.</li>
<li> Violation of the principals information hiding and encapsulation.</li>
<li> Necessitates a separate business layer to contain the logic otherwise located in a domain model. It also means that domain model&#8217;s objects cannot guarantee their correctness at any moment, because their validation and mutation logic is placed somewhere outside (most likely in multiple places).</li>
<li> Necessitates a global access to internals of shared business entities increasing coupling and fragility.</li>
<li> Facilitates code duplication among transactional scripts and similar use cases, reduces code reuse.</li>
<li> Necessitates a service layer when sharing domain logic across differing consumers of an object model.</li>
<li> Makes a model less expressive and harder to understand.</li>
</ul>
<p>The difference between ADM and RDM is the focus of control. In the former, the services has the control and in the later domain objects controls the services. It is shown in the following diagram.<br />
<a href="http://guptavikas.wordpress.com/files/2009/11/domain-modelling1.png"><img class="aligncenter size-medium wp-image-42" title="domain-modelling" src="http://guptavikas.wordpress.com/files/2009/11/domain-modelling1.png?w=300" alt="" width="573" height="360" /></a><br />
Another benefit that differentiates ADM and RDM is that in ADM a developer has to understand two layers, service layer and domain layer but in RDM once you get the grasp of domain model, which is essentially a model of the domain logic, you get a grasp of the business and can work productively to enhance the software. RDM also makes code cohesive.</p>
<p>Experts also advocate to consider maintainability while deciding to choose between various approaches. In his book PoEEA, Fowler explains this with the help of a diagram which is shown below<br />
<a href="http://guptavikas.wordpress.com/files/2009/11/maintainability.png"><img class="aligncenter size-medium wp-image-42" title="maintainability" src="http://guptavikas.wordpress.com/files/2009/11/maintainability.png?w=300" alt="" width="530" height="373" /></a><br />
The source of the above diagram is not known. But, according to this diagram, it takes time to pick up speed with the domain model. Of course, with skilled developers the initial startup time reduces. But, as the complexity of the application increases, it becomes increasingly difficult to maintain the application if it is coded with TS pattern. TM pattern delays the cutoff point where DM takes over, but TM is advocated for .Net environments as Visual Studio provides tools which work well with TM.</p>
<p><strong>Conclusion</strong><br />
In this blog, we discussed various patterns for organizing domain logic in enterprise applications. Clearly, there is no silver bullet which fits all scenarios. Since, we work with object-oriented programming languages, it is advisable to work with approaches like DM to encapsulate business logic. Also, it makes working with complex applications easier as the complexity of the application increases. DM helps in abstracting a model of the real world domain logic in the code which once understood can make working on the applications more productive and fruitful. For simple applications, TS/ADM meets the requirements.</p>
<p>But, how to decide whether the application is complex or easy. Most of the metrics talk about the complexity once the software has been coded by analyzing if-else statements, cyclomatic complexity, etc. But, here, we are talking about predicting complexity, and there is no known metric which can objectively tell that. However, it can be subjectively predicted by knowledge of the domain of the software, which is gained by experience.</p>
<p>Another and most important factor which must be taken into consideration is maintainability. Although it cannot be quantitatively measured, but since we work in to the objective oriented world, DM seems to have an edge over other approaches and it employs inheritance, polymorphism, etc to encapsulate the domain logic.</p>
<p>As a final word, all the above domain model patterns are not mutually exclusive and an understanding of all of above might help us decide an approach for developing a particular software.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Agile revelations part 2]]></title>
<link>http://implementingagile.wordpress.com/2009/11/21/agile-revelations-part-2/</link>
<pubDate>Sat, 21 Nov 2009 23:04:52 +0000</pubDate>
<dc:creator>Paul Harrington</dc:creator>
<guid>http://implementingagile.wordpress.com/2009/11/21/agile-revelations-part-2/</guid>
<description><![CDATA[My last Agile Revelations post was an unexpected foray into the reasons behind why I love Agile so m]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>My last <a href="http://implementingagile.wordpress.com/2009/09/11/agile-revelations/">Agile Revelations</a> post was an unexpected foray into the reasons behind why I love Agile so much. Written on a Friday night, a bit bored, it started me thinking about my career in software development and how I got to this point in my life.</p>
<p>So if you weren&#8217;t put off by my previous post and are still interested in what motivates people like me to pursue this most rewarding of methodologies then read on&#8230;&#8230;..</p>
<p>So where was I? Oh yes, I was still in my first development job and I&#8217;d just finished reading <a href="http://www.amazon.co.uk/Extreme-Programming-Explained-Embrace-Change/dp/0321278658">Extreme Programming: embrace change</a> by Kent Beck &#8211; the book which single-handedly inspired me to take on Agile. I&#8217;d been in that role for about a year by the time I finished the book and at around the same time I completed my full MCSD in my spare time. And it was lucky because within a month my company had no more C# work for me (they&#8217;d decided to re-write in java) so I took a junior C# developer role with a new company.</p>
<p>The development work there was challenging for a relatively in-experienced developer so I found it hard work implementing real WinForms and ASP.Net Web applications into production, but the hardest thing about it was that between projects there was a lot of &#8220;sitting around time&#8221; where we would be waiting for work (read spec documents as it was a classic waterfall environment!). This was so immensely painful as I hate being bored, having to pester people to give me work to do so in the end I used this time to improve my development skills and learn more about Agile.</p>
<p>The funny thing is that nowadays “being Agile” is such a buzz word and everybody and his dog is claiming that their company is doing it. But at the time it still felt very new (well I guess it was in the UK) and it wasn’t enough to just read buzz word books about XP &#8211; I wanted to learn the coding principles behind Agile and understand what made these programmers (apparently) so talented.</p>
<p>So I spent loads of time reading blogs, researching who was saying the most about Agile and XP and (to name but a few) I came up with some very well known writers on these subjects: <a href="http://www.martinfowler.com/bliki/">Martin Fowler</a>, <a href="http://www.threeriversinstitute.org/blog/?p=29">Kent Beck</a> and my own personal God <a href="//codebetter.com/blogs/jeremy.miller/">Jeremy Miller</a>.</p>
<p>I quickly realised that an Agile methodogy is useless if you don&#8217;t know how to write quality code so I started buying books which concentrated on improving development skills and writing clean code, here are just a few I started out with:</p>
<p><a href="http://www.amazon.co.uk/Refactoring-Improving-Design-Existing-Technology/dp/0201485672">Refactoring</a> by Martin Fowler<br />
<a href="http://www.amazon.co.uk/Test-Driven-Development-Addison-Wesley-Signature/dp/0321146530">Test Driven Development</a> by Kent Beck<br />
<a href="http://www.amazon.co.uk/Enterprise-Application-Architecture-Addison-Wesley-signature/dp/0321127420">POEAA</a> by Martin Fowler<br />
<a href="http://www.amazon.co.uk/Head-First-Design-Patterns-Freeman/dp/0596007124">Head first Design Patterns</a> by the Freemans<br />
<a href="http://www.amazon.co.uk/Applying-Domain-Driven-Design-Patterns-Using/dp/0321268202">Applying DDD</a> by Jimmy Nilsson</p>
<p>And that was how I spent my 2nd year in software development. It was an interesting time and for anyone just starting out I would definitely recommend these writers (and obviously a whole load more now &#8211; you&#8217;ll have to wait for part 3 for those!). The only caveat I would say is that these guys are so good that I did sometimes feel out of my depth, thinking I would never be able to write code as well as them (which is probably still true but I do at least now try!). I think this was probably a very natural reaction but to counter it I would recommend that rather than just reading about the concepts, try to implement them as often as you can in production code.  With that said, the best way to ultimately learn is to find an environment with technically excellent, like minded people, eager to learn the same values and able to implement them in production.</p>
<p>Enter <a href="www.uswitch.com">uSwitch</a> stage left <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Until next time&#8230;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring Framework Terminologies]]></title>
<link>http://tecnoesis.wordpress.com/2009/11/19/spring-terminologies/</link>
<pubDate>Thu, 19 Nov 2009 14:08:27 +0000</pubDate>
<dc:creator>Rajani Ramsagar</dc:creator>
<guid>http://tecnoesis.wordpress.com/2009/11/19/spring-terminologies/</guid>
<description><![CDATA[  Chapter 1: Terminologies   Design Patterns: A design pattern is a conceptual general reusable solu]]></description>
<content:encoded><![CDATA[  Chapter 1: Terminologies   Design Patterns: A design pattern is a conceptual general reusable solu]]></content:encoded>
</item>
<item>
<title><![CDATA[Creational design patterns]]></title>
<link>http://solutionsarchitecture.wordpress.com/2009/11/17/creational-design-patterns/</link>
<pubDate>Tue, 17 Nov 2009 11:39:00 +0000</pubDate>
<dc:creator>J@F</dc:creator>
<guid>http://solutionsarchitecture.wordpress.com/2009/11/17/creational-design-patterns/</guid>
<description><![CDATA[This design patterns is all about class instantiation. This pattern can be further divided into clas]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>This design patterns is all about class instantiation. This pattern can be further divided into class-creation patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.</p>
<p>Creational patterns become important as systems evolve to depend more on object composition than class inheritance.</p>
<ul>
<li><strong>Abstract Factory</strong></li>
</ul>
<p>Creates an instance of several families of classes</p>
<ul>
<li><strong>Builder</strong></li>
</ul>
<p style="padding-left:30px;">Separates object construction from its representation</p>
<ul>
<li><strong>Factory Method</strong></li>
</ul>
<p style="padding-left:30px;">Creates an instance of several derived classes</p>
<ul>
<li><strong>Object Pool</strong></li>
</ul>
<p style="padding-left:30px;">Avoid expensive acquisition and release of resources by recycling objects that are no longer in use</p>
<ul>
<li><strong>Prototype</strong></li>
</ul>
<p style="padding-left:30px;">A fully initialized instance to be copied or cloned</p>
<ul>
<li><strong>Singleton</strong></li>
</ul>
<p style="padding-left:30px;">A class of which only a single instance can exist</p>
<p>Soon I&#8217;ll start posting detailed description of each one o these design paters.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Design Pattern (@pattern tag?)]]></title>
<link>http://arniie.wordpress.com/2009/11/17/design-pattern-pattern-tag/</link>
<pubDate>Tue, 17 Nov 2009 11:11:46 +0000</pubDate>
<dc:creator>arniie</dc:creator>
<guid>http://arniie.wordpress.com/2009/11/17/design-pattern-pattern-tag/</guid>
<description><![CDATA[Last week, the tech team and I (at Clock Ltd) with the help of  iBuildings, were discussing Design P]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Last week, the tech team and I (at Clock Ltd) with the help of <a href="http://www.lornajane.net/" target="_blank"> iBuildings</a>, were discussing Design Patterns and OO.</p>
<p>We discussed that in some of the frameworks/projects we had worked on the class or filename was the actual design pattern, for instance Factory.php which contains the class Factory, which seemingly helped readability and understanding of what the class is doing or what it is about.</p>
<p>However! a class may happen to be a singleton, but that&#8217;s not its main purpose in life, so I think naming it Singleton is perhaps a bad idea&#8230; which then lead me to think that the best way to get this method of readability/understanding across maybe to use the comments&#8230; <a href="http://sourceforge.net/tracker/?func=detail&#38;aid=2899028&#38;group_id=11194&#38;atid=361194" target="_blank"></a></p>
<p><a href="http://sourceforge.net/tracker/?func=detail&#38;aid=2899028&#38;group_id=11194&#38;atid=361194" target="_blank">&#8230;perhaps phpdoc should contain a new @pattern tag</a>? (or perhaps phpdoc has another tag that could be utilised for this purpose?)</p>
<p>I think this would be extremely useful for maintenance of code, and understanding of the original authors ideas of the code.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Design Pattern Relationships]]></title>
<link>http://nasir.wordpress.com/2009/11/17/design-pattern-relationships/</link>
<pubDate>Tue, 17 Nov 2009 06:54:07 +0000</pubDate>
<dc:creator>nasir</dc:creator>
<guid>http://nasir.wordpress.com/2009/11/17/design-pattern-relationships/</guid>
<description><![CDATA[Useful diagram showing relationship between different design patterns from GoF.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Useful diagram showing relationship between different design patterns from GoF.</p>
<p><a href="http://nasir.wordpress.com/files/2009/11/design_patterns1.jpg"><img src="http://nasir.wordpress.com/files/2009/11/design_patterns1.jpg?" alt="Design Pattern Relationship" title="Design Patterns" class="alignnone" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Design Patterns - again]]></title>
<link>http://designjedi.wordpress.com/2009/11/16/design-patterns-again/</link>
<pubDate>Mon, 16 Nov 2009 19:45:32 +0000</pubDate>
<dc:creator>designjedi</dc:creator>
<guid>http://designjedi.wordpress.com/2009/11/16/design-patterns-again/</guid>
<description><![CDATA[I talked about patterns back in July and here I am again talking about them. Rightly so, why design ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I talked about patterns back in July and here I am again talking about them.</p>
<p>Rightly so, why design something that there are already best practices for?</p>
<p><strong>Recap</strong></p>
<p><strong>Design patterns</strong> were first described in the 1960s by  Christopher Alexander, an architect who noticed that many things in our lives  happen according to patterns. He adapted his observations to his work and  published many findings on the topic. In User Experience, <strong>design  pattern</strong> refers to a reusable and applicable solution to general  real-world problems. For example, a solution for navigating around a website is  site navigation (a list of links that point to different sections of the site),  a solution for displaying content in a compact space are module tabs. There are  many ways to tackle a specific requirement – and as a designer – the most  important thing you can do is selecting the option that best reflects the needs  of your users.</p>
<p><strong>40+ Helpful Resources On User Interface Design Patterns</strong></p>
<p>There is an article on <a href="http://www.smashingmagazine.com/2009/06/15/40-helpful-resources-on-user-interface-design-patterns/">Smahing  Magazine</a> which highlights what it thinks to be the best of the best sites  for design patterns. I find myself using this article again and again to  reference these sites.</p>
<p>My personal favorites are:</p>
<p><a href="http://ui-patterns.com/">UI-patterns.com</a><br />
UI-patterns.com is a  large collection of design patterns for UI designers to gain inspiration from.  The site allows users to keep sets of their own (publicly accessible to site  visitors) so that you can see other UI design pattern collections.</p>
<p><img class="alignnone" title="UI patterns" src="http://media.smashingmagazine.com/wp-content/uploads/images/ui-design-patterns/uip.gif" alt="" width="364" height="255" /></p>
<p><a href="http://www.welie.com/patterns/index.php">Interaction Design Pattern  Library</a><br />
Welie.com has an interaction design pattern library maintained by  <a href="http://www.welie.com/about/index.php">Martijn van Welie</a>, a Ph. D.  graduate in Human Computer Interaction who now works as an Interaction Design  Senior Consultant for Philips Design. The library features a ton of design  patterns involving various site tasks such as navigating around a site,  searching a site, and basic interactions such as <a href="http://www.welie.com/patterns/showPattern.php?patternID=slideshow">slideshows</a>.  Each pattern follows a specific format: (1) the problem, (2) the solution, (3)  when to use the pattern, (4) why you should use the design pattern, and (5)  examples of the pattern in use.</p>
<p><a href="http://quince.infragistics.com/">QUINCE: X Patterns  Explorer</a><br />
QUINCE is a beautiful and stunning web application that helps  you explore an innumerable amount of user experience design patterns such as <a href="http://quince.infragistics.com/#/Search/ViewPattern$pattern=Date+Picker">date  pickers</a> and <a href="http://quince.infragistics.com/#/Search/ViewPattern$pattern=Date+Picker">two-panel  selectors</a>. The application requires the Silverlight plugin and is best  viewed under Internet Explorer (though we have verified it to work well in  Firefox and Safari).</p>
<p><a href="http://www.designofsites.com/home/">Design of sites</a></p>
<p>The website is derived from the book and claims to be the definitive  reference for the principles, methodologies, and best practices for exceptional  Web design.</p>
<p><a href="http://designingwebinterfaces.com/explore">Designing Web Interfaces</a></p>
<p>This website is also derived from the book Designing Web Interfaces and lacks  detial but has some good stuff on it.</p>
<p><img class="alignnone" title="Designing web interfaces" src="http://designingwebinterfaces.com/images/cover.gif" alt="" width="180" height="236" /></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Domain Classes - initial draft]]></title>
<link>http://projectmefisto.wordpress.com/2009/11/16/domain-classes-initial-draft/</link>
<pubDate>Mon, 16 Nov 2009 02:40:29 +0000</pubDate>
<dc:creator>aberrante</dc:creator>
<guid>http://projectmefisto.wordpress.com/2009/11/16/domain-classes-initial-draft/</guid>
<description><![CDATA[At a very high level and as a first draft, I propose the following classes that will serve as the ba]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>At a very high level and as a first draft, I propose the following classes that will serve as the base for my design:</p>
<p><strong><span style="text-decoration:underline;">Investment: positions and portfolios<br />
</span></strong></p>
<p>Investments are at the base of everything: they are the basic unit into which money can be <em>put to work, </em>that is, investments will have <em>value</em> which more or less can be transformed into cash.</p>
<p>Responsibilities:</p>
<ul>
<li>Calculate value at a given date. Value will be probably the most important quantity in the system. At the end of the day, everything is about value and how to add it. An investment object will be responsible to provide an accurate estimation of its own value.</li>
<li>Maintain positions in individual instruments and/or portfolios. This will probably lead to the composite design pattern. Investments can be made in a particular instrument or a portfolio of investments, that is, portfolios will be composed of investments. In the end, this will also define the portfolio/position structure in a tree-like form.</li>
<li>Maintain cash position. Necessary for implementing investment strategies.</li>
<li>Estimate transaction costs. Will probably refer to a new class of &#8220;brokers/dealers&#8221;, each with its own transaction cost structure. For the time being, that class will probably be a null cost structure.</li>
</ul>
<p>Collaborations:</p>
<ul>
<li>Instruments. Values are calculated as the position quantity times the instrument&#8217;s price or the portfolio&#8217;s value. In the case of leaves (portfolios), the calculation will be driven by instrument prices. Instruments will probably be implemented using a flyweight pattern to reduce the amount of simulations required to produce reliable theoretical prices.</li>
</ul>
<p><strong><span style="text-decoration:underline;">Instrument</span></strong></p>
<p>Instruments are responsible to provide a price, historical or produced by a model. Historical prices will be loaded from a database. Models will be associated with instruments on a one-to-one relationship (using the bridge pattern). This will provide the flexibility to develop the portfolio/instrument management system independently from the pricing models.</p>
<p>As well, it would be beneficial to refer one single instrument to all the positions in the same instrument. This seems a likely place for the flyweight pattern. Flyweight instruments would be put in place, where are links to the actual instruments would be kept by the positions. The benefits of this are when simulations are run and try to enforce a single representation of each object in reality to an object in the model.</p>
<p>Responsibilities:</p>
<ul>
<li>Provide its own price at a given date.</li>
</ul>
<ul>
<li>Maintain a link to a pricing model.</li>
</ul>
<p>Collaborations:</p>
<ul>
<li>Flyweight pattern will ensure that only one instrument object is instantiated and referenced in the different positions held among portfolios. This will require that the investment class provide an encapsulation for the external state of each flyweight. As far as I have thought, only position data could be considered as external encapsulation.</li>
</ul>
<p><strong><span style="text-decoration:underline;">PricingModel</span></strong></p>
<p>PricingModels will be instantiated on a one-to-one relationship with instruments (bridge pattern). They will be the providers of theoretical prices which ultimately will be functions of scenarios.</p>
<p>Responsibilities:</p>
<ul>
<li>Provide theoretical price as a function of risk factors.</li>
<li>Provide interface for scenarios. Each scenario will be a set of risk factors. The interface required will tell some sort of scenario generator what risk factors the model needs, this way each simulation can be constructed ad-hoc.</li>
</ul>
<p>Collaborations:</p>
<ul>
<li>Instruments (Bridge pattern). The primary reason models exist is to represent the actual price which can fetch a transaction in an instrument in the market. The reason why this class exists is to encapsulate the behaviour of providing a theoretical price. In this manner the library of pricing models (our understanding of the world) can be independent of the actual instrument (the world).</li>
</ul>
<p><strong><span style="text-decoration:underline;">Curves: risk factors and scenarios</span></strong></p>
<p>The Curves class will implement a Composite Design Pattern similarly to the positions/portfolio pattern. A question to decide is how to represent &#8216;actual&#8217; curves: as an additional composite of individual nodes (leaves) or let the implementation handle everything?</p>
<p>The curves class will have to subclasses: risk factors and scenarios. Risk factors are the theoretical constructs in which our instruments&#8217; pricing models depend. It is between the selection of the pricing models and the representation of risk factors that the quality of our theoretical pricing depends. A risk factor is responsible of providing its state. In order to provide its state, the risk factor must calibrate itself with a set of instruments.</p>
<p>Responsibilities:</p>
<ul>
<li>Provide its state. Historical and calibrated states will be required.</li>
<li>Calibrate itself to a set of instruments.</li>
</ul>
<p><strong><span style="text-decoration:underline;">Analysis: statistical, risk, technical, &#8230;<br />
</span></strong></p>
<p>Analyses will be operations performed on portfolios. They will primarily entail a large set of generated scenarios under which the value of investments will be calculated and reported. Scenarios might be historical or theoretical.</p>
<p>I need more time on this.</p>
<p><strong><span style="text-decoration:underline;">Others</span></strong></p>
<p>Other classes will be needed for interfacing with data bases, data mapping, GUI and report generation.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Quicknotes on Core J2EE Patterns]]></title>
<link>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-core-j2ee-patterns/</link>
<pubDate>Sat, 14 Nov 2009 00:45:55 +0000</pubDate>
<dc:creator>MF</dc:creator>
<guid>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-core-j2ee-patterns/</guid>
<description><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Following patterns are descr]]></description>
<content:encoded><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Following patterns are descr]]></content:encoded>
</item>
<item>
<title><![CDATA[C# Design Patterns Tour]]></title>
<link>http://spolnik.wordpress.com/2009/11/13/c-design-patterns-tour/</link>
<pubDate>Fri, 13 Nov 2009 19:15:31 +0000</pubDate>
<dc:creator>Jacek Spólnik</dc:creator>
<guid>http://spolnik.wordpress.com/2009/11/13/c-design-patterns-tour/</guid>
<description><![CDATA[Decorator Pattern Another Example Proxy Pattern Bridge Pattern Composite Pattern Flyweight Pattern A]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><ol>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/06/27/design-patterns-in-c-part-1-decorator-pattern/" target="_blank">Decorator Pattern</a>
<ul>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/06/27/another-example-of-the-decorator-design-pattern/" target="_blank">Another Example</a></li>
</ul>
</li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/06/29/design-patterns-in-c-part-2-proxy-pattern/" target="_blank">Proxy Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/01/design-patterns-in-c-part-3-bridge-pattern/" target="_blank">Bridge Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/04/design-patterns-in-c-part-4-composite-pattern/" target="_blank">Composite Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/12/design-patterns-in-c-part-5-flyweight-pattern/" target="_blank">Flyweight Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/16/design-patterns-in-c-part-6-adapter-pattern/" target="_blank">Adapter Pattern</a>
<ul>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/16/two-way-adapter-pattern-example-from-c-design-patterns-book/" target="_blank">Two Way Adapter Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/18/pluggable-adapter-in-c/" target="_blank">Pluggable Adapter Pattern</a></li>
</ul>
</li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/18/design-patterns-in-c-part-7-facade-pattern/" target="_blank">Facade Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/19/design-patterns-in-c-part-8-prototype-pattern/" target="_blank">Prototype Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/19/design-patterns-in-c-part-9-factory-method-pattern/" target="_blank">Factory Method Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/19/design-patterns-in-c-part-10-singleton-pattern/" target="_blank">Singleton Pattern</a>
<ul>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/19/singleton-pattern-generic-code-example-from-c-3-0-design-patterns/" target="_blank">Generic Singleton Pattern</a></li>
</ul>
</li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/19/design-patterns-in-c-part-11-abstract-factory-pattern/" target="_blank">Abstract Factory Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/25/design-patterns-in-c-part-12-builder-pattern/" target="_blank">Builder Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/25/design-patterns-in-c-part-13-strategy-pattern/" target="_blank">Strategy Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/25/design-patterns-in-c-part-14-state-pattern/" target="_blank">State Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/25/design-patterns-in-c-part-15-template-method-pattern/" target="_blank">Template Method Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/26/design-patterns-in-c-part-16-chain-of-responsibility-pattern/" target="_blank">Chain Of Responsibility Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/29/design-patterns-in-c-part-17-command-pattern/" target="_blank">Command Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/29/design-patterns-in-c-part-18-iterator-pattern/" target="_blank">Iterator Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/30/design-patterns-in-c-part-19-mediator-pattern/" target="_blank">Mediator Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/30/design-patterns-in-c-part-20-observer-pattern/" target="_blank">Observer Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/07/31/design-patterns-in-c-part-21-visitor-pattern/" target="_blank">Visitor Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/08/01/design-patterns-in-c-part-22-interpreter-pattern/" target="_blank">Interpreter Pattern</a></li>
<li><a class="wp-caption" href="http://spolnik.wordpress.com/2009/08/01/design-patterns-in-c-part-23-memento-pattern/" target="_blank">Memento Pattern</a></li>
</ol>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Introduction About MVVM - Model View ViewModel Design Pattern]]></title>
<link>http://solutionsarchitecture.wordpress.com/2009/11/13/introduction-about-mvvm-model-view-viewmodel-design-pattern/</link>
<pubDate>Fri, 13 Nov 2009 10:04:21 +0000</pubDate>
<dc:creator>J@F</dc:creator>
<guid>http://solutionsarchitecture.wordpress.com/2009/11/13/introduction-about-mvvm-model-view-viewmodel-design-pattern/</guid>
<description><![CDATA[Last week was my first presentation while playing the Solution Architect Role in ArabiaGIS, so I tri]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Last week was my first presentation while playing the Solution Architect Role in ArabiaGIS, so I tried to start with an introduction to design patterns, and my first subject was the Model-View-ViewModel design pattern. in the presentation I tried to introduce the design pattern concept, showing its importance and the goals off applying it.</p>
<p>The presentation will focus on the history and the importance of MVVM and then go into the detailed of this important design pattern for architecting a WPF application.</p>
<p> To see the presentation: <a href="http://www.slideshare.net/Jaffel/introduction-to-design-pattern-mvvm">http://www.slideshare.net/Jaffel/introduction-to-design-pattern-mvvm</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Method Chaining pattern]]></title>
<link>http://katatunix.wordpress.com/2009/11/13/method-chaining-pattern/</link>
<pubDate>Fri, 13 Nov 2009 06:10:08 +0000</pubDate>
<dc:creator>Katatunix</dc:creator>
<guid>http://katatunix.wordpress.com/2009/11/13/method-chaining-pattern/</guid>
<description><![CDATA[Method Chaining là một kỹ thuật lập trình đơn giản có thể được cài đặt trên hầu hết các ngôn ngữ lập]]></description>
<content:encoded><![CDATA[Method Chaining là một kỹ thuật lập trình đơn giản có thể được cài đặt trên hầu hết các ngôn ngữ lập]]></content:encoded>
</item>
<item>
<title><![CDATA[Quicknotes on Concurrency Patterns]]></title>
<link>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-concurrency-patterns/</link>
<pubDate>Fri, 13 Nov 2009 05:05:47 +0000</pubDate>
<dc:creator>MF</dc:creator>
<guid>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-concurrency-patterns/</guid>
<description><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Please note that, most of th]]></description>
<content:encoded><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Please note that, most of th]]></content:encoded>
</item>
<item>
<title><![CDATA[Quicknotes on Behavioral Patterns]]></title>
<link>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-behavioral-patterns/</link>
<pubDate>Fri, 13 Nov 2009 05:04:06 +0000</pubDate>
<dc:creator>MF</dc:creator>
<guid>http://mf9it.wordpress.com/2009/11/13/quicknotes-on-behavioral-patterns/</guid>
<description><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Please note that, most of th]]></description>
<content:encoded><![CDATA[This is one of the posts on &#8220;Quicknotes on Design Patterns&#8221; Please note that, most of th]]></content:encoded>
</item>
<item>
<title><![CDATA[Missing the "OH" in your SOA]]></title>
<link>http://shawnp40.wordpress.com/2009/11/23/missing-the-oh-in-your-soa/</link>
<pubDate>Mon, 23 Nov 2009 19:44:26 +0000</pubDate>
<dc:creator>shawnp40</dc:creator>
<guid>http://shawnp40.wordpress.com/2009/11/23/missing-the-oh-in-your-soa/</guid>
<description><![CDATA[Pattern-Oriented development is paramount in IT.  Patterns are used for designing software [POSA], i]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Pattern-Oriented development is paramount in IT.  Patterns are used for designing software [POSA], integrating applications [EIP] or building enterprise systems [PEAA].  They make us feel comfortable that are our solution in the end will be extensible, reusable and hopefully along the way we managed avoiding some age-old pitfalls.</p>
<p>One thing enterprise software architecture teaches us is to rely on layers.  There are various patterns and styles of layers but more than likely if you are missing layers you are missing the mark with your framework.  Inside the context of integration landscapes and even application development, the introduction of “services” has greatly improved our ability to leverage layers well – make them more understandable, reusable and frankly standard.</p>
<h1>Services &#38; Layers</h1>
<p>Services can mean lots of things, from a simple exposed interface to a data object, to an managed end-to-end business process, to an  interactive SOAP web service or EJB.  But at the end of the day, the term service has become common with the “stuff” or components we should be interacting within our layers.</p>
<p>If it’s a data layer, then provide me data-access CRUD like services.  If it’s a domain layer, provide me with business process logic.  If it’s an application layer, provide me with interface adaptors.  It it’s a presentation layer, provide me with representational views. And the list goes on and on, but we all agree we should be employing our patterns with services in mind in both development and discussion.</p>
<p>Does this therefore mean all architecture lends itself to Service-Oriented Architecture?  Well – no.  Service abstraction is something service-oriented architecture leverages but in practice an SOA is far more.  Furthermore, I contend that due to this lack of understanding, there is a very high risk of creating a “Service Architecture” (SA) and missing the boat all together on the sought after “Service-Oriented Architecture” (SOA).</p>
<h1>Service Architecture</h1>
<p>The SA is something we rarely talk about and only whispers can be heard of it in JAD meetings, or final production audits.  As a definition, I will give it this:  An Integration Landscape focusing on providing interoperability primarily through exposing and managing services across the enterprise.   In short, take your spaghetti code and stovepipe applications – re-architect them using services and layers (ignoring the true patterns from whence they came) – and you are left with an expensive replica of what you had: a point-to-point mess only this time with fancy service names attached to all those tightly-coupled interfaces.  And just because you decided to run all this on top of the latest “ESB” you hope to god the resultant SOA guarantees all the power it touts.  For this reason, I have grown to hate the term “integration point”.  As if all I need to do is define some necessary communication /action and provide some code to interoperate and “voila”, a true “service” comes out and now we are on our way to an SOA.  Sorry to say nope – designing integration landscapes by focusing on integration points, will usually get you quickly to a place where “web” and “point” are frowned upon.  (Referring the web chaos of point-to-point architectures).  Unless of course you were going for P2P, but since this BLOG is about SOA, I would assume you are not – and thus frowning is applicable.</p>
<h1>Service-Oriented Architecture</h1>
<p>SOA has evolved to mean so much, maybe too much, but at the least it is associated with a series of highly desired characteristics of enterprise application architecture.  Benefits like agility, governability, real-time, guaranteed, extensible and intelligent add to our ROI while benefits like reusability, maintainability, operational efficiency, automation, auditability reduce our TCO.  So how do we ensure we get all this?  Is it even possible?  Or is SOA another ivory tower pipe dream big software vendors and consultants are helping us peddle?</p>
<p>Check out some of my previous postings for definitions of an SOA – but in short, I would have preferred the “S” stood for Standard.  As in the tried and true standards that have really stood the test of time and now we finally are smart enough to realize it and start repeating it rather than conjuring up something new for our own ego sake.  However, for this posting I will offer this up for defining an SOA: An Integration Landscape that provides both interoperability and infrastructure through a strategic enterprise solution embodying connectivity, consolidation, composition and completeness.  Before I get hammered by the SOA for dummies people who say where is mention of the business people, this is meant to constrain SOA as an integration landscape not a project methodology.  I am not trying to redefine IT departments and IT business as we know it, just pointing out that when I look at what was actually implemented, how can I tell if it was more of an “SA” or “SOA”.  Besides, I added words like “enterprise” and consolidation to include the “business” (yes the stakeholders and business owners are important) – you cannot achieve consolidation or completeness without the business. See my blog on SOA Maturity.</p>
<p>The big deal here is the combination of technology, infrastructure (IT resources and Business resources where resources are people, processes and tangible assets) and standardization in a way that shows evolution and maturity of thought on both sides.  ESBs, web services, integration points, BPM or even technology patterns can not achieve this alone.  For an SOA to begin to produce all the benefits it so badly wants to, it needs some old school experience to pave the way.  Don’t throw out all your old PM methodologies or Architectural gurus in favor for new age hype.  Slow down, question why, document decisions points, make sure you are actually modeling your business not technology or a deadline, and for goodness sake, make sure the solution everyone is going for actually makes sense.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
