<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mpadaka</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mpadaka"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Mpadaka"/>
	<updated>2026-08-09T01:08:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26207</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26207"/>
		<updated>2009-10-15T01:23:10Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
==Traditional Web Application==&lt;br /&gt;
[[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|700x800px|Traditional Web Application]] &lt;br /&gt;
&lt;br /&gt;
== SOA based Web Application==&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Examples of usage of various patterns&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade Pattern&amp;lt;/b&amp;gt;: Lets say a company is trying to develop an entity service, called Assessments service, which will produce a range of reports and this service needs to access a number of repositories in order to gather all the required data. There exists a component based architecture that contains a Data Controller component which executes the same logic, however this component must remain independant and cannot be altered to support the new entity service. Here, an intermediate service facade component would allow the original Data Controller Component to work independantly but also allow the service facade component to utilise its logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper Pattern&amp;lt;/b&amp;gt;: If, in the example above, the Data Controller component is modified such that it does not provide access to one of the data repositories. The data access functinality to the Assessments service is partly lost. To resolve this, the developers notice that the repository in question is part of a legacy environment that runs on mainframe technologies. So they build a new Utility service to wrap this legacy mainframe system which helps them communicate with the repository by converting messages/data to the required format. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled contract Pattern&amp;lt;/b&amp;gt;: Continuing with the example above, with the Assessment service, new services are designed as new projects emerge. Lets say one project deals with delivering a Fines and Evaluation service. This Service needs to access the database that the Data Controller uses. A decision is made to change the Data Controller component. But the probelm that arises is that the Data Controller is a standalone Java EJB([http://java.sun.com/products/ejb/ Enterprise JavaBeans]), while the Fines and Evaluation Service is standardized on the web services technology framework([http://en.wikipedia.org/wiki/XML XML] and [http://www.w3.org/TR/wsdl WSDL] schema definitions). The data controller needs to comply with this as well, thus it needs to be equipped with a decoupled service contract that exists independantly from its underlying service logic and can be used as a web service.&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26205</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26205"/>
		<updated>2009-10-15T01:22:15Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
==Traditional Web Application==&lt;br /&gt;
[[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|700x800px|Traditional Web Application]] &lt;br /&gt;
&lt;br /&gt;
== SOA based Web Application==&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examples of usage of various patterns:&lt;br /&gt;
&lt;br /&gt;
Service Facade Pattern: Lets say a company is trying to develop an entity service, called Assessments service, which will produce a range of reports and this service needs to access a number of repositories in order to gather all the required data. There exists a component based architecture that contains a Data Controller component which executes the same logic, however this component must remain independant and cannot be altered to support the new entity service. Here, an intermediate service facade component would allow the original Data Controller Component to work independantly but also allow the service facade component to utilise its logic.&lt;br /&gt;
&lt;br /&gt;
Legacy Wrapper Pattern: If, in the example above, the Data Controller component is modified such that it does not provide access to one of the data repositories. The data access functinality to the Assessments service is partly lost. To resolve this, the developers notice that the repository in question is part of a legacy environment that runs on mainframe technologies. So they build a new Utility service to wrap this legacy mainframe system which helps them communicate with the repository by converting messages/data to the required format. &lt;br /&gt;
&lt;br /&gt;
Decoupled contract Pattern: Continuing with the example above, with the Assessment service, new services are designed as new projects emerge. Lets say one project deals with delivering a Fines and Evaluation service. This Service needs to access the database that the Data Controller uses. A decision is made to change the Data Controller component. But the probelm that arises is that the Data Controller is a standalone Java EJB([http://java.sun.com/products/ejb/ Enterprise JavaBeans]), while the Fines and Evaluation Service is standardized on the web services technology framework([http://en.wikipedia.org/wiki/XML XML] and [http://www.w3.org/TR/wsdl WSDL] schema definitions). The data controller needs to comply with this as well, thus it needs to be equipped with a decoupled service contract that exists independantly from its underlying service logic and can be used as a web service.&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26029</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26029"/>
		<updated>2009-10-14T17:10:41Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
==Traditional Web Application==&lt;br /&gt;
[[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|700x800px|Traditional Web Application]] &lt;br /&gt;
&lt;br /&gt;
== SOA based Web Application==&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26028</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26028"/>
		<updated>2009-10-14T17:09:49Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|700x800px|Traditional Web Application]] &lt;br /&gt;
&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26027</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26027"/>
		<updated>2009-10-14T17:09:25Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|700x800px|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26026</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26026"/>
		<updated>2009-10-14T17:09:08Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|700x800px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|500x500px|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26025</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26025"/>
		<updated>2009-10-14T17:08:35Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|frame|alt=SOA based Web Application|500x500px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|500x500px|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26024</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26024"/>
		<updated>2009-10-14T17:08:17Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|120p|alt=SOA based Web Application|500x500px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|120p|alt=Traditional Web Applicatioo|500x500px|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26023</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26023"/>
		<updated>2009-10-14T17:07:49Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|50p|alt=SOA based Web Application|500x500px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26022</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26022"/>
		<updated>2009-10-14T17:07:08Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|50p|alt=SOA based Web Application|size=500x500px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26021</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26021"/>
		<updated>2009-10-14T17:06:55Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|frame|alt=SOA based Web Application|size=500x500px|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26020</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26020"/>
		<updated>2009-10-14T17:06:32Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|frame|alt=SOA based Web Application|size=500x500|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26019</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26019"/>
		<updated>2009-10-14T17:06:17Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|thumb|alt=SOA based Web Application|size=500x500|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26018</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26018"/>
		<updated>2009-10-14T17:05:39Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|thumb|alt=SOA based Web Application|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|thumb|alt=Traditional Web Applicatioo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26015</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26015"/>
		<updated>2009-10-14T17:03:18Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|50p|alt=Puzzle globe logo|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|50p|alt=Puzzle globe logo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26014</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26014"/>
		<updated>2009-10-14T17:02:53Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|110p|alt=Puzzle globe logo|SOA based Web Application]] [[Image:traditionalWebApplication.jpg|110p|alt=Puzzle globe logo|Traditional Web Application]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26013</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=26013"/>
		<updated>2009-10-14T16:55:37Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
[[Image:soa.jpg|frame|alt=Puzzle globe logo|Ruby Logo]] [[Image:traditionalWebApplication.jpg|frame|alt=Puzzle globe logo|Ruby Logo]] &lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enable the creation of effective service-oriented solutions, but also to provide effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on [http://www.whatissoa.com/p13.asp service inventory architecture]. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and [http://www.managingautomation.com/maonline/magazine/read/view/SOAIn_The_Know_2129939 capabilities]. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position [http://en.wikipedia.org/wiki/Service-oriented_architecture#Other_SOA_concepts contracts] as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented](OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means to assemble and compose together the basic entity's(Objects and classes in terms of traditional patterns and Services in terms of SOA patterns) logic. Logic is aggregated to solve one or more larger problems. They help ensure&lt;br /&gt;
that this decomposition of one entity into two or more does not impact the contract (technical interface) of the original piece, thereby also avoiding impact to that entity's consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pattern frequently applied to the initial design of service architecture is the Service Façade. Drawn mostly from the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core service logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements just like the Adapter pattern, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. An example where classes have incompatible interfaces due to a modification, these patterns help by translating one interface for a class into a compatible interface to allow all the other classes to work together. They actually providing their interface to clients on the outside while internally using the original incompatible interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of services is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation just like the bridge pattern, which '&amp;lt;i&amp;gt;decouples an abstraction from its implementation&amp;lt;/i&amp;gt;'. It allows the service contract to be created as a physically separate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;OO - [http://en.wikipedia.org/wiki/Object-oriented_programming Object oriented]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:TraditionalWebApplication.jpg&amp;diff=26010</id>
		<title>File:TraditionalWebApplication.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:TraditionalWebApplication.jpg&amp;diff=26010"/>
		<updated>2009-10-14T16:51:05Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Soa.jpg&amp;diff=26008</id>
		<title>File:Soa.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Soa.jpg&amp;diff=26008"/>
		<updated>2009-10-14T16:50:28Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24524</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24524"/>
		<updated>2009-10-09T21:48:39Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to [http://en.wikipedia.org/wiki/Composite_pattern Composite Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. For example, they help ensure&lt;br /&gt;
that this decomposition of one service into two or more does not impact the contract (technical interface) of the original service, thereby also avoiding impact to that service’s consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Facade_pattern Facade Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A key pattern frequently applied to the initial design of service architecture is the Service Façade. Inspired by the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core serivce logic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. For example, translating one interface for a class into a compatible interface to allow classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] (SOA) is similar to [http://en.wikipedia.org/wiki/Mediator_pattern Mediator Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
Non-Agnostic Context provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with [http://en.wikipedia.org/wiki/Bridge_pattern Bridge Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24512</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24512"/>
		<updated>2009-10-09T21:43:26Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition Pattern] (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. For example, they help ensure&lt;br /&gt;
that this decomposition of one service into two or more does not impact the contract (technical interface) of the original service, thereby also avoiding impact to that service’s consumer programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A key pattern frequently applied to the initial design of service architecture is the Service Façade. Inspired by the Façade pattern created by the Gang of Four, this pattern wedges a component between the service contract and the core service logic to establish a point of abstraction. It provides supplemental, intermediate processing logic in support of the core serivce logic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper Pattern] (SOA) is derived from [http://en.wikipedia.org/wiki/Adapter_pattern Adapter Pattern] (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These patterns are used to address various implementation and scalability-related requirements, while maintaining the overall flexibility required for services to be repeatedly composed and extended, as required. For example, translating one interface for a class into a compatible interface to allow classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is similar to Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Agnostic (&amp;quot;without knowledge&amp;quot;) logic is logic that is sufficiently generic so that it is not specific to (has no knowledge of) a particular  parent task is classified as agnostic logic. Agnostic logic is considered multi-purpose; logic that is specific to (contains knowledge of) a single-purpose task is labeled as non-agnostic logic. Another way of thinking about agnostic and non-agnostic logic is to focus on the extent to which the logic can be re-purposed. &lt;br /&gt;
&lt;br /&gt;
[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic Context] provide criteria that help determine whether certain kinds of logic are deemed sufficiently agnostic to be put into a reusable or multi-purpose service.&lt;br /&gt;
&lt;br /&gt;
SOA's Non-Agnostic Context Patterns and traditional GoF's Mediator design pattern serve similar purposes. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract Pattern] (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. These patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24394</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24394"/>
		<updated>2009-10-09T20:23:32Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition]:&amp;lt;/b&amp;gt; These patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Composite_pattern Composite]:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.soapatterns.org/service_facade.asp Service Facade]:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Facade_pattern Facade]:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.soapatterns.org/legacy_wrapper.asp Legacy Wrapper]:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Adapter_pattern Adapter]:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.soapatterns.org/non_agnostic_context.asp Non-Agnostic context]:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Mediator_pattern Mediator]:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.soapatterns.org/decoupled_contract.asp Decoupled Contract]:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Bridge_pattern Bridge]:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24390</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24390"/>
		<updated>2009-10-09T20:20:37Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://www.informit.com/articles/article.aspx?p=1271262 Capability Composition]:&amp;lt;/b&amp;gt; These patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[http://en.wikipedia.org/wiki/Composite_pattern Composite]:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24387</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24387"/>
		<updated>2009-10-09T20:19:08Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as [http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming) inheritance], [http://en.wikipedia.org/wiki/Encapsulation_(computer_science)#Encapsulation encapsulation], and [http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming polymorphism] that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; These patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24377</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24377"/>
		<updated>2009-10-09T20:10:43Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientated (OO) concepts such as inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. Software, developers and architects noticed some patterns that can be applied to the usage of OO principles to solve similar types of problems. A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides (&amp;quot;Gang of Four&amp;quot; authors). In OO the first-class constructs were objects and classes.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [http://www.wikipedia.org/ Wikipedia]&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://my.safaribooksonline.com/9780137149476/ch04 Executing SOA: A Practical Guide for the Service-Oriented Architect]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24361</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24361"/>
		<updated>2009-10-09T20:05:11Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Services are business-aligned entities and are at a much higher level of abstraction than are objects and components. The main first-class constructs in an SOA are services, service components, and process flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design explains how to effectively design an SOA using services, service components, and process flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24342</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24342"/>
		<updated>2009-10-09T19:58:26Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24336</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24336"/>
		<updated>2009-10-09T19:56:42Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24334</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24334"/>
		<updated>2009-10-09T19:56:25Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24332</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24332"/>
		<updated>2009-10-09T19:55:56Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; &amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24331</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24331"/>
		<updated>2009-10-09T19:55:42Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24323</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24323"/>
		<updated>2009-10-09T19:53:35Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24318</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24318"/>
		<updated>2009-10-09T19:52:38Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Differences between SOA design patterns and traditional patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns:&amp;lt;/b&amp;gt; &lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24315</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24315"/>
		<updated>2009-10-09T19:52:02Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24313</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24313"/>
		<updated>2009-10-09T19:50:36Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24311</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24311"/>
		<updated>2009-10-09T19:49:47Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Similarities between traditional design patterns and the SOA design patterns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation.&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24305</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24305"/>
		<updated>2009-10-09T19:47:11Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h4&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h4&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24302</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24302"/>
		<updated>2009-10-09T19:45:26Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Level of granularity that the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition:&amp;lt;/b&amp;gt; these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Composite:&amp;lt;/b&amp;gt; the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade:&amp;lt;/b&amp;gt; Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Facade:&amp;lt;/b&amp;gt; A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper:&amp;lt;/b&amp;gt; Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Adapter:&amp;lt;/b&amp;gt; the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-Agnostic context:&amp;lt;/b&amp;gt; When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mediator:&amp;lt;/b&amp;gt; This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h3&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract:&amp;lt;/b&amp;gt; Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bridge:&amp;lt;/b&amp;gt; The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24299</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24299"/>
		<updated>2009-10-09T19:41:57Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  The need for [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Service Oriented Architecture ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What is the aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What do the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What level of granularity do the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;How is interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Capability Composition: these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. &lt;br /&gt;
&lt;br /&gt;
Composite: the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Service Facade: Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
Facade: A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Legacy Wrapper: Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
Adapter: the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Non-Agnostic context: When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory. &lt;br /&gt;
&lt;br /&gt;
Mediator: This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;h3&amp;gt;&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&amp;lt;/h3&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoupled Contract: Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation. &lt;br /&gt;
&lt;br /&gt;
Bridge: The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24295</id>
		<title>CSC/ECE 517 Fall 2009/wiki2 16 am</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki2_16_am&amp;diff=24295"/>
		<updated>2009-10-09T19:38:22Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==  Why do we need [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture -- SOA]  ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The need for building new systems is to achieve simplicity of usage and reuse existing software solutions for new challenges. Simplicity is lost in the process when real dependencies are overtaken by artificial dependencies. To differentiate between real and artificial dependencies, let us consider the example when we travel overseas on business. We know that we must bring our own power adapters along or life can be miserable. The real dependency is that we need power; the artificial dependency is that our plug must fit into the local outlet. So in order to build a simple system, the principle needs to be such that 'artificial dependencies should be reduced to the minimum but real dependencies should not be altered'. Applying this principle to the example, it means that the artificial dependencies between the power plugs and the power outlets should be minimized and the components should be made more loosely connected to each other. To achieve this principle, we seek the idea of SOA. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Let us define SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;  [http://en.wikipedia.org/wiki/Service-oriented_architecture Service-Oriented Architecture ](SOA) can be defined as an [http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science) Architectural design pattern] that concerns itself with defining loosely-coupled relationships between producers and consumers. A [http://ondotnet.com/pub/a/dotnet/2003/08/18/soa_explained.html service] is a unit of work done by a service provider to achieve desired end results for a service consumer. Both provider and consumer are roles played by software agents on behalf of their owners. It provides us with a set of principles of governing concepts used during phases of systems development and integration. Such an architecture will package functionality as 'interoperable services' ( As in the example given above, Adapters for plugs ): software modules provided as a service can be integrated or used by several organizations, even if their respective client systems (Different power outlets) are substantially different . It is an attempt to develop yet another means for software module integration. &lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rather than defining an [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface -- API] or a bunch of hierarchical classes, SOA defines the interface in terms of protocols and functionality. An endpoint is the entry point to such an SOA implementation. SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications. These services communicate with each other by passing data from one service to another, or by coordinating an activity between two or more services. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Design patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; A design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. &lt;br /&gt;
&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;It is a description or template for how to solve a problem that can be used in many different situations.&amp;lt;/li&amp;gt; &lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns typically show relationships and interactions between entities, without specifying the final actual clients that are involved. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.&amp;lt;/li&amp;gt; &amp;lt;/ul&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Role of design patterns in SOA ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;When carrying out an SOA initiative, we need to pay attention to many design details with every service we deliver, while always keeping the big picture in our sights. Design patterns support us in maintaining this balance by helping us overcome common obstacles that have historically inhibited or even derailed SOA project plans. They establish an environment that is conducive not just to enabling the creation of effective service-oriented solutions, but also to enabling the effective long-term governance and evolution of the individual services that can be composed and recomposed to comprise these solutions. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Categories of SOA Design Patterns ==&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Category !! Objective&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch6 Foundational Inventory Patterns]&amp;lt;/b&amp;gt; || These patterns define an SOA model with an emphasis on service inventory architecture. Examples: enterprise inventory, domain inventory, service normalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch7 Logical Inventory Layer Patterns] &amp;lt;/b&amp;gt;|| These patterns establish service layers based on utility service models, business-logic entity service models, and single-purpose task service models. Examples: utility abstraction, entity abstraction, process abstraction.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch8 Inventory Centralization Patterns]&amp;lt;/b&amp;gt; || These patterns address physical aspects of service inventory architecture. Examples: process centralization, schema centralization, policy centralization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch9 Inventory Implementation Patterns] &amp;lt;/b&amp;gt;|| These patterns help solve implementation-level problems. Examples: dual protocols, canonical resources, state repository.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch10 Inventory Governance Patterns] &amp;lt;/b&amp;gt;|| These patterns supply fundamental design-time solutions for post-implementation services evolution. Examples: canonical expression, metadata centralization, canonical versioning.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch11 Foundational Service Patterns]&amp;lt;/b&amp;gt; || These patterns represent the steps required to partition and organize logic into services and capabilities. Examples: functional decomposition, service encapsulation, agnostic context.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch12 Service Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns impact or augment the physical implementation of the service architecture, to help respond to ongoing changes, address scalability, and runtime message processing. Examples: service façade, redundant implementation, service data replication.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch13 Service Security Patterns]&amp;lt;/b&amp;gt; || These patterns extend service design in support of increased protection from security threats. Examples: exception shielding, message screening, trusted subsystem.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch14 Service Contract Design Patterns] &amp;lt;/b&amp;gt;|| These patterns help position contracts as independent yet still central parts of service architectures. Examples: decoupled contract, contract centralization, contract denormalization.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch15 Legacy Encapsulation Patterns] &amp;lt;/b&amp;gt;|| These patterns address common challenges with service encapsulation of legacy systems and environments. Examples: legacy wrapper, multi-channel endpoint, file gateway.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch16 Service Governance Patterns]&amp;lt;/b&amp;gt; || These patterns help evolve services without compromising their responsibilities as active members of the service inventory. Examples: compatible change, version identification, termination notification.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch17 Capability Composition Patterns] &amp;lt;/b&amp;gt;|| These patterns provide a means by which to assemble and compose together the service logic resulting from service identification and definition patterns. Examples: capability composition, capability recomposition.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch18 Service Messaging Patterns]&amp;lt;/b&amp;gt; || These patterns provide various techniques for processing and coordinating data exchanges between services. Examples: service messaging, messaging metadata, service agent.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch19 Composition Implementation Patterns]&amp;lt;/b&amp;gt; || These patterns provide design solutions that address implementation-level issues pertaining primarily to runtime service activity management and composition structure. Examples: agnostic sub-controller, composition autonomy, atomic service transaction.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch20 Service Interaction Security Patterns] &amp;lt;/b&amp;gt;|| These patterns focus on applying security at the message level. Examples: data confidentiality, data origin authentication, direct authentication.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;b&amp;gt; [http://www.soapatterns.org/masterlist_c.asp#ch21 Transformation Patterns] &amp;lt;/b&amp;gt; || These patterns address the interoperability obstacles of communications, data formats, and data models. Examples: data model transformation, data format transformation, protocol bridging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;b&amp;gt;[http://www.soapatterns.org/masterlist_c.asp#ch22 Common Compound Design Patterns]&amp;lt;/b&amp;gt; || These patterns document the effects of applying multiple patterns together. Examples: official endpoint, federated endpoint layer, three-layer inventory.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SOA design patterns and traditional design patterns [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four -- GoF] patterns ==&lt;br /&gt;
&lt;br /&gt;
Object orientation (OO) brought in concepts of inheritance, encapsulation, and polymorphism that could be applied to define relationships between classes. With the prevalence of the use of OO in the programming world, developers and architects started noticing some patterns that can be applied to the usage of OO principles to solve similar types of problems. The patterns depicted the deconstruction of a problem into multiple class entities, together with their interrelationships using the basic concepts of OO, to provide a solution to the problem. The seminal work in this field was done by the Gang of Four authors in the book called Design Patterns: Elements of Reusable Object-Oriented Software. Whereas in OO the first-class constructs were objects and classes, the next-generation methodology for building software applications was called component-based development (CBD). In CBD, the first-class constructs were components, where a component was defined by its external specification, which could be used without any knowledge of its internal implementation. As such, the same external specification could be implemented in different programming language (for example, Java, C#). The internal implementation of a component may use multiple classes that collectively provide the implementation of the external specification. The classes could use one or more design patterns, thereby leveraging the advantages of OO principles.&lt;br /&gt;
&lt;br /&gt;
In SOA, the main emphasis is on the identification of the right services followed by their specification and realization. Although some might argue that object-oriented analysis and design (OOAD) techniques can be used as a good starting point for services, its main emphasis is on microlevel abstractions. Services, on the other hand, are business-aligned entities and therefore are at a much higher level of abstraction than are objects and components.&lt;br /&gt;
&lt;br /&gt;
The main first-class constructs in an SOA are services, service components, and process flows. For the sake of brevity, we refer to process flows as just flows. These are at a level of abstraction that is higher than that of objects, classes, and components. Hence, there needs to be a higher level of modeling and design principles that deal with the first-class constructs of an SOA. Service-oriented modeling and design is a discipline that provides prescriptive guidance about how to effectively design an SOA using services, service components, and flows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Differences between SOA design patterns and traditional patterns ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What is the aim of design patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are more about Modeling, Design, Architecture&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns are about Modeling, Design, Architecture and Programming&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What do the design patterns expose&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns expose services&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns expose methods&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;What level of granularity do the design patterns provide&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns exhibit business-level granularity&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns exhibit component/object-level granularity&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;How is interaction provided in the patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns interact at the service-level, inter-service via service requests&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns interact component/object-level, inter-objects/components via method calls&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;b&amp;gt;Standards for patterns&amp;lt;/b&amp;gt; --&lt;br /&gt;
&amp;lt;br&amp;gt;SOA patterns are in the nascent stages. They are being collected and organised from emerging best practices.&lt;br /&gt;
&amp;lt;br&amp;gt;GoF patterns contain a lot of best practices and excellent tools. They have a mature knowledge base in the industry.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Similarities between traditional design patterns and the SOA design patterns==&lt;br /&gt;
&lt;br /&gt;
A variety of design patterns which supported object-orientation have been published by Gamma, Helm, Johnson, Vlissides. This set of 23 patterns produced by the &amp;quot;Gang of Four&amp;quot; helped established object-orientation as a design approach for distributed solutions. Some of these patterns have persisted within service-orientation as detailed below: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Capability Composition Pattern (SOA) is related to Composite Pattern (Traditional)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Capability Composition: these patterns provide the means by which to assemble and compose together the service logic. These patterns are the means by which service logic is aggregated to solve one or more larger problems. When you require access to logic that falls outisde a service's boundary, capability logic within the service composes one or more capabilities in other services. &lt;br /&gt;
&lt;br /&gt;
Composite: the composite pattern is a partitioning design pattern. Composite allows a group of objects to be treated in the same way as a single instance of an object. The intent of composite is to &amp;quot;compose&amp;quot; objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions uniformly. In object-oriented programming, a composite is an object (e.g., a shape) designed as a composition of one-or-more similar objects (other kinds of shapes/geometries), all exhibiting similar functionality. This is known as a &amp;quot;has-a&amp;quot; relationship between objects. The key concept is that you can manipulate a single instance of the object just as you would manipulate a group of them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Service Facade Pattern (SOA) is derived from Facade Pattern (Traditional)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Service Facade: Service facade logic is primarily responsible for providing supplemental, intermediate processing logic in support of the core serivce logic. This helps a service accommodate changes to its contract or implementation while allowing the core service logic to evolve independently.&lt;br /&gt;
&lt;br /&gt;
Facade: A facade is an object that provides a simplified interface to a larger body of code, such as a class library. A facade can make a software library easier to use and understand, since the facade has convenient methods for common tasks. A facade can make code that uses the library more readable, reduce dependencies of outside code on the inner workings of a library,&lt;br /&gt;
wrap a poorly-designed collection of APIs with a single well-designed API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Legacy Wrapper Pattern (SOA) is derived from Adapter Pattern (Traditional)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Legacy Wrapper: Legacy systems must often be encapsulated by services established by proprietary component APIs. The resulting technical interface is frequently fixed and no - customizable. Because the contract is pre-determined by the product vendor on constrained by the legacy component APIs, it is not compliant with contract design standards. Such a non-standard wrapper service can be repalced by or wrapped with a standardized service contract that extracts ecapsulates and possibly eliminates legacy technical details from the contract.&lt;br /&gt;
&lt;br /&gt;
Adapter: the adapter design pattern (often referred to as the wrapper pattern or simply a wrapper) translates one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces, by providing its interface to clients while using the original interface. The adapter translates calls to its interface into calls to the original interface, and the amount of code necessary to do this is typically small. The adapter is also responsible for transforming data into appropriate forms. For instance, if multiple boolean values are stored as a single integer but your consumer requires a 'true'/'false', the adapter would be responsible for extracting the appropriate values from the integer value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Non-agnostic Context Pattern (SOA) is associated with Mediator Pattern (Traditional)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Non-Agnostic context: When applying service orientation , there is more emphasis on abstracting and positioning solution logic that is agnostic to business tasks and processes. Thus non-agnostic logic gets filtered out and often encapsulated by software programs that are peripherals (not part of the service inventory). Non-agnostic context patterns have logic that is suitable for service encapsulation and can be located within services that reside as official members of a service inventory. &lt;br /&gt;
&lt;br /&gt;
Mediator: This pattern provides a unified interface to a set of interfaces in a subsystem. This pattern is considered to be a behavioral pattern due to the way it can alter the program's running behavior. Usually a program is made up of a (sometimes large) number of classes. So the logic and computation is distributed among these classes. However, as more classes are developed in a program, especially during maintenance and/or refactoring, the problem of communication between these classes may become more complex. This makes the program harder to read and maintain. Furthermore, it can become difficult to change the program, since any change may affect code in several other classes. With the mediator pattern communication between objects is encapsulated with a mediator object. Objects no longer communicate directly with each other, but instead communicate through the mediator. This reduces the dependencies between communicating objects, thereby lowering the coupling.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Decoupled Contract Pattern (SOA) is associated with Bridge Pattern (Traditional)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Decoupled Contract: Services built using component-centric technologies such as .NET and Java require the service contract to be expressed via the same native technologies used to build the components. Thus the utilization and evolution of servies is inhibited because they can only be used by the consumer programs compatible with their technology. Decoupled Contract patterns enable the service contract to be physically decoupled from its implementation. It allows the service contract to be created as a physically seperate part of the overall service implementation. &lt;br /&gt;
&lt;br /&gt;
Bridge: The bridge is a deisgn pattern meant to &amp;quot;decouple an abstraction from its implementation so that the two can vary independently&amp;quot;. The bridge uses encapsulation, aggregation, and can use inheritance to separate responsibilities into different classes. When a class varies often, the features of object-oriented programming become very useful because changes to a program's code can be made easily with minimal prior knowledge about the program. The bridge pattern is useful when both the class as well as what it does varies. The class itself can be thought of as the implementation and what the class can do as the abstraction. The bridge pattern can also be thought of as two layers of abstraction.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Text - Design Patterns: Elements of Reusable Object-Oriented Software (E. Gamma, R. Helm, R. Johnson, J. Vlissides, Addison-Wesley 1994)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Text - SOA Design Patterns by Thomas Erl &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soaglossary.com/ SOA Glossary]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.xml.com/pub/a/ws/2003/09/30/soa.html  SOA]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org  SOA design patterns] &amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.soapatterns.org/soa_patterns_article.pdf  Need for SOA design patterns]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://schneider.blogspot.com/2008/06/gartner-soa-design-patterns.html SOA design patterns observed by Gartner analysts]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://soa-eda.blogspot.com/2007/01/what-is-service-in-soa.html What is a Service?]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Abbreviations ==&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;SOA - [http://en.wikipedia.org/wiki/Service-oriented_architecture Service Oriented Architecture]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;API - [http://en.wikipedia.org/wiki/Application_programming_interface Application Programming Interface]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;GoF - [http://en.wikipedia.org/wiki/Design_Patterns:_Elements_of_Reusable_Object-Oriented_Software Gang of Four]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19358</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19358"/>
		<updated>2009-09-16T19:08:59Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* '''Project Environments Suited to Each''' */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19354</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19354"/>
		<updated>2009-09-16T19:07:48Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19353</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19353"/>
		<updated>2009-09-16T19:06:43Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Purely Object Oriented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
'''Purely Object Oriented'''&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19349</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19349"/>
		<updated>2009-09-16T19:04:07Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: /* Purely Object Oriented */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19346</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19346"/>
		<updated>2009-09-16T19:03:18Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
:  0.zero?    This evaluates to a true&lt;br /&gt;
:  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19344</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19344"/>
		<updated>2009-09-16T19:02:42Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
:===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19342</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19342"/>
		<updated>2009-09-16T19:01:59Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
1===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
:With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
:Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
:'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
:Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
:Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
:'''Java''':&lt;br /&gt;
:If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
:'''Python''':&lt;br /&gt;
:Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
:Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
:'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
:Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
:Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
:Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19341</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19341"/>
		<updated>2009-09-16T18:59:07Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
1===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
:Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19340</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19340"/>
		<updated>2009-09-16T18:55:34Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide [http://www.rubycentral.com/pickaxe/irb.html interactive shells] (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs (Integrate Development Environments) are available for Python, including GUI (Graphical User Interface) debuggers. A [http://www.gnu.org/software/gdb/ gdb]-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [http://en.wikipedia.org/wiki/Model–view–controller MVC (Model-View-Controller)] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19339</id>
		<title>CSC/ECE 517 Fall 2009/wiki1a 11 f1,</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2009/wiki1a_11_f1,&amp;diff=19339"/>
		<updated>2009-09-16T18:49:53Z</updated>

		<summary type="html">&lt;p&gt;Mpadaka: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Ruby and Python are both scripting languages whose popularity has sky rocketed in recent years. Both languages are &lt;br /&gt;
[http://en.wikipedia.org/wiki/High_level_language High-Level], [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science) Garbage-collected], and [http://en.wikipedia.org/wiki/Dynamically_typed#Dynamic_typing Dynamically-typed]. Both provide an interactive shell, standard libraries, and persistence support. So, what are the differences?&lt;br /&gt;
[[Image:ruby.jpg|frame|alt=Puzzle globe logo|Ruby Logo]]  [[Image:python.jpg|frame|alt=Puzzle globe logo|Python Logo]]&lt;br /&gt;
&lt;br /&gt;
Points of comparison:&lt;br /&gt;
* Language Features: Ruby vs Python&lt;br /&gt;
* Programming environments&lt;br /&gt;
* Features exclusive to each of Ruby and Python&lt;br /&gt;
* Advantages of Ruby/Python over statically typed languages such as Java&lt;br /&gt;
* Project environments suited to each&lt;br /&gt;
&lt;br /&gt;
=='''Language Features: Ruby vs Python'''==&lt;br /&gt;
&lt;br /&gt;
===Access Protection ===&lt;br /&gt;
&lt;br /&gt;
Ruby supports private, protected and public types of access (like java)to the elements of a class. By default all methods are public except the initialize method and all instance variables are private. One of the differences of Ruby compared to Python is that Ruby keeps all of its instance variables completely private to the class and only exposes them through accessor methods (attr_writer, attr_reader, etc).&lt;br /&gt;
&lt;br /&gt;
Python's property descriptors are similar, but come with a trade-off in the development process. If one begins in Python by using a publicly exposed instance variable and later changes the implementation to use a private instance variable exposed through a property descriptor, code internal to the class may need to be adjusted to use the private variable rather than the public property. Ruby removes this design decision&lt;br /&gt;
&lt;br /&gt;
===Functions and methods ===&lt;br /&gt;
&lt;br /&gt;
In Ruby, the part which is different from Python is the fact that all operations are messages to objects. There are no separate &lt;br /&gt;
functions and methods; all of them are methods.&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
puts string.count('o'), string.length  # prints 2, 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In Python, there are separate methods and functions as shown in the example below.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
string = 'Hello world'&lt;br /&gt;
print string.count('o'), len(string)  # prints 2, 11 – why not string.len()?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Ruby has reference to class in class body ===&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass&lt;br /&gt;
    initialize_magick()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rubys variant is cleaner, as the magic stuff is done in the class definition, so you see that it’s being done when you look at the class.&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyClass:&lt;br /&gt;
    pass&lt;br /&gt;
initialize_magick(MyClass)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it’s really not a big deal, because calling the initialise method after the class or as a decorator is really not a major drawback.&lt;br /&gt;
&lt;br /&gt;
=== Self Reference ===&lt;br /&gt;
&lt;br /&gt;
In Python, one needs to write ''self'' as the first parameter of a method definition (alike Perl). Furthermore, Python doesn’t  require the variable name to be self. In Ruby, ''self'' is automatically available in a similar fashion as in C++.&lt;br /&gt;
&lt;br /&gt;
Additionally, the method call ''self.method'' can be shortened to ''method'', as ''self'' is the default receiver.&lt;br /&gt;
&lt;br /&gt;
=== Ruby continuations vs Python Generators ===&lt;br /&gt;
&lt;br /&gt;
[http://www.stackless.com/spcpaper.htm Continuation] is a &amp;quot;pointer&amp;quot; to the current position in your program, including calling stack and all variables. You can reuse that pointer to &amp;quot;go back in time&amp;quot; when needed. Continuations are useful when it comes to ''usecases''.  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def loop&lt;br /&gt;
  cont=nil&lt;br /&gt;
  for i in 1..4&lt;br /&gt;
    puts i&lt;br /&gt;
    callcc {|continuation| cont=continuation} if i==2&lt;br /&gt;
  end&lt;br /&gt;
  return cont&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Python doesn't support full continuations or even co-routines; instead it supports &amp;quot;generator&amp;quot; functions which create a kind of limited co-routine.&lt;br /&gt;
A [http://www.stackless.com/spcpaper.htm generator] in python is implemented as a special syntax for creating an instance of an iterator object, which returns the values returned by the &amp;quot;function&amp;quot; definition you provide. Python generators are easy and clean.&lt;br /&gt;
The equivalent code for the above code segment, in python is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from generator_tools import copy_generator&lt;br /&gt;
&lt;br /&gt;
def _callg(generator, generator_copy=None):&lt;br /&gt;
    for _ in generator: # run to the end&lt;br /&gt;
        pass&lt;br /&gt;
    if generator_copy is not None:&lt;br /&gt;
        return lambda: _callg(copy_generator(generator_copy))&lt;br /&gt;
&lt;br /&gt;
def loop(c):&lt;br /&gt;
    c.next() # advance to yield's expression&lt;br /&gt;
    return _callg(c, copy_generator(c))&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    def loop_gen():&lt;br /&gt;
        i = 1&lt;br /&gt;
        while i &amp;lt;= 4:&lt;br /&gt;
            print i&lt;br /&gt;
            if i == 2:&lt;br /&gt;
                yield&lt;br /&gt;
            i += 1&lt;br /&gt;
&lt;br /&gt;
    c = loop(loop_gen())&lt;br /&gt;
    print(&amp;quot;c:&amp;quot;, c)&lt;br /&gt;
    for _ in range(2):&lt;br /&gt;
        print(&amp;quot;c():&amp;quot;, c())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
Python uses whitespace indentation, rather than curly braces or keywords, to delimit statement blocks (a feature also known as the off-side rule). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.&lt;br /&gt;
On the other hand, ruby doesn't need any indentation although it can be optionally used for clarity.&lt;br /&gt;
&lt;br /&gt;
=== Other Differences ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby&lt;br /&gt;
!  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Higher-Order Functions&lt;br /&gt;
|  Implemented with procedure objects&lt;br /&gt;
|  Implemented as lambda expressions&lt;br /&gt;
|-&lt;br /&gt;
|  Arrays and hashes&lt;br /&gt;
|  supports Arrays and associative arrays (Hash)&lt;br /&gt;
|  has Lists and Tuples which are the same as arrays.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Memory management&lt;br /&gt;
|  has a mark and sweep garbage collector&lt;br /&gt;
|  has a reference counting garbage collector.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  Parallel assignment&lt;br /&gt;
|  claims to do Operating System independent threading.&lt;br /&gt;
|  Threading available on many common platforms with some threading support&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Package support &lt;br /&gt;
| Not available&lt;br /&gt;
| Available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== '''Programming Environments''' ==&lt;br /&gt;
&lt;br /&gt;
===Development Environments===&lt;br /&gt;
&lt;br /&gt;
Both languages provide interactive shells (type &amp;quot;python&amp;quot; or &amp;quot;irb&amp;quot;) and high-level [http://www.ibm.com/developerworks/library/l-pypers.html persistence] support. Multiple IDEs are available for Python, including GUI debuggers. A gdb-style debugger is available for each language. Python has a RefactoringBrowser, BicycleRepairMan. RubyLanguage now has a [http://www.kmc.gr.jp/proj/rrb/index-en.html RubyRefactoringBrowser]&lt;br /&gt;
&lt;br /&gt;
Both languages are supported by Emacs modes. Python can be used as an elisp replacement - see Pymacs. The current Ruby implementation is closely tied to Unix, making Windows performance and ports to new platforms problematic. There is an Eclipse [http://en.wikipedia.org/wiki/Integrated_development_environment IDE] for Ruby. RubyCocoa adds support for Ruby to ProjectBuilder/ExCode on MacOsx. &lt;br /&gt;
&lt;br /&gt;
===Web Programming Environments ===&lt;br /&gt;
&lt;br /&gt;
Both Ruby and Python have a large number of web programming environments/ application frameworks. They are exhaustively listed and compared [http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Python here]. For brevity, we compare ruby's [http://en.wikipedia.org/wiki/Ruby_on_rails Ruby on Rails] with python's [http://en.wikipedia.org/wiki/Django_(web_framework) Django].  The need was to compare two frameworks which were developed independent of each other and not based or influenced on the other. Hence the choice of django was made, as other web python frameworks like pylons and web2py are based  on rails. &lt;br /&gt;
&lt;br /&gt;
Django is a complete Python web application framework while rails is an agile web programming environment built in Ruby which greatly simplifies [[w:http://en.wikipedia.org/wiki/Model–view–controller MVC]] framework development. Ruby OO programming topics in conjunction with various Rails recipes are considered a much lighter, simpler and faster development experience than other current enterprise frameworks provided today.&lt;br /&gt;
&lt;br /&gt;
The table below compares them.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!  Feature&lt;br /&gt;
!  Ruby on Rails&lt;br /&gt;
!  Django&lt;br /&gt;
|-&lt;br /&gt;
|  Language&lt;br /&gt;
|  Ruby&lt;br /&gt;
|  Python&lt;br /&gt;
|-&lt;br /&gt;
|  Ajax&lt;br /&gt;
|  Prototype, script.aculo.us&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC framework&lt;br /&gt;
|  ActiveRecord, Action Pack&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  MVC Push/Pull&lt;br /&gt;
|  Push&lt;br /&gt;
|  Push 	 	 	 	 	&lt;br /&gt;
|-&lt;br /&gt;
| i18n &amp;amp; l10n?&lt;br /&gt;
| Localization, Plug-in &lt;br /&gt;
| Yes &lt;br /&gt;
|-&lt;br /&gt;
|  ORM&lt;br /&gt;
|  ActiveRecord&lt;br /&gt;
|  Django ORM&lt;br /&gt;
|-&lt;br /&gt;
|  Testing framework(s)&lt;br /&gt;
|  Unit Tests, Functional Tests and Integration Tests&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  DB migration framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  No (plugin exists, might be merged into trunk when more stable and feature complete)&lt;br /&gt;
|-&lt;br /&gt;
|  Security Framework(s)&lt;br /&gt;
|  Plug-in&lt;br /&gt;
|  ACL-based&lt;br /&gt;
|-&lt;br /&gt;
|  Template Framework(s)  &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Caching Framework(s)&lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|-&lt;br /&gt;
|  Form Validation Framework(s) &lt;br /&gt;
|  Yes&lt;br /&gt;
|  Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=='''Features exclusive to each of Ruby and Python'''==&lt;br /&gt;
&lt;br /&gt;
===Python Advantages===&lt;br /&gt;
&lt;br /&gt;
* Python has multiple inheritance &lt;br /&gt;
* Python has docstrings : Docstrings makes it possible to attach documentation directly to the classes and methods. That’s a nice documentation plus, and makes things like the Python interpreters ''help()'' function really useful. &lt;br /&gt;
&lt;br /&gt;
===Ruby Advantages===&lt;br /&gt;
&lt;br /&gt;
* Ruby blocks are much more powerful than Python lambdas and they are integrated pervasively into the language. They also allow interaction between the block and the container.&lt;br /&gt;
* Metaprogramming (modifying classes on the fly) is easier in Ruby than in Python. Interestingly, in the Ruby community this is considered a powerful feature and used frequently, whereas the Python community tends to think of it as a last resort.&lt;br /&gt;
* Ruby is very good at creating domain-specific mini-languages. This is a consequence of the easy metaprogramming and optional parentheses on function calls.&lt;br /&gt;
&lt;br /&gt;
=='''Advantages of Ruby/Python over statically typed languages such as Java'''==&lt;br /&gt;
&lt;br /&gt;
The term [http://en.wikipedia.org/wiki/Dynamic_programming_language Dynamic language] refers to high level programming language that allows the programmer to modify the code during run time. The modifications may include addition of new blocks of code or modifications to objects during execution or changing the type of objects. Statically typed languages such as Java or C# have these operations performed during compile-time as opposed to run-time. further Ruby and Python are dynamically typed; type checking is performed at run-time and typing isn't enforced as strictly as it is in a statically typed language. For example, if an object being passed as an argument to a function doesn't match the type of the argument, but does have a method that matches what is being called, program execution runs normally. This isn't the case in a statically typed language where programmers should declare the types they intend a method or function to use and the compiler will not permit the programmer to ignore this type. &lt;br /&gt;
&lt;br /&gt;
Advantages of a dynamic language are many. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages are compatible over many platforms. &lt;br /&gt;
&lt;br /&gt;
*Dynamic languages emphasize on the code instead of the structure/ architecture of code. So coding is easier when you don't have to worry about syntax errors and adhering to the language specifications. &lt;br /&gt;
&lt;br /&gt;
*Dynamic code can be written much faster than static code. &lt;br /&gt;
&lt;br /&gt;
*[http://www.ibm.com/developerworks/linux/library/l-metaprog1.html Metaprogramming] is easier in a dynamic language. Dynamic languages are suitable if you are working on a template system, or a [http://www.martinfowler.com/bliki/DomainSpecificLanguage.html Domain Specific Language (DSL)], a [http://en.wikipedia.org/wiki/Automatic_programming Code Generator], a [http://en.wikipedia.org/wiki/Parsing Parser] or other type of application that can build applications.  While Static languages can do these things, it takes a lot more effort to achieve it when compared to a dynamic language. &lt;br /&gt;
&lt;br /&gt;
However, a word of warning when starting out using a dynamic language: Dynamic languages put more of a responsibility on the developer when coding. Instead of having a structured syntax that makes sure that the programmer does not make blatant errors, the onus is on the programmer himself. Also, Dynamic languages have a lot of built in shortcuts that ends up revealing code that is not really readable for a beginner. &lt;br /&gt;
&lt;br /&gt;
To aid in understanding how '''Ruby (or Python)''' are better than a static language such as '''Java''', consider the examples below: &lt;br /&gt;
&lt;br /&gt;
===Purely Object Oriented===&lt;br /&gt;
&lt;br /&gt;
Ruby does not have primitives. everything, including integers are full fledged objects.&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  0.zero?    This evaluates to a true&lt;br /&gt;
  1.zero?    This evaluates to a false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Typed features===&lt;br /&gt;
&lt;br /&gt;
With Static typing in Java and C#, programmers should declare the types they want a method or function to use while with Ruby you don't declare types for variables or functions. In Ruby objects are strongly and dynamically typed.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int val1=5;&lt;br /&gt;
String value=String.valueOf(val1);&lt;br /&gt;
if(value.equals(&amp;quot;5&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
val1=5&lt;br /&gt;
value=str(val1)&lt;br /&gt;
if value == &amp;quot;5&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Verbosity===&lt;br /&gt;
&lt;br /&gt;
Statically typed languages tend to be more verbose. &lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import java.io.*;&lt;br /&gt;
BufferedReader file1=new BufferedReader(new FileReader(Filename));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
file=open(Filename);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Relaxed syntax===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python are flexible with respect to syntax. For example,&lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat = Cat.new  &lt;br /&gt;
cat = Cat.new()  &lt;br /&gt;
cat = Cat.new();  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More compact code===&lt;br /&gt;
&lt;br /&gt;
'''Java''':  &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for (int i = 0; i &amp;lt; 100; i++) &lt;br /&gt;
{}  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;  &lt;br /&gt;
100.times { |i| }  &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Default Arguments===&lt;br /&gt;
&lt;br /&gt;
Ruby and Python allow you to define default values to method arguments while Java does not. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def calc_cube(x=2,y=3)&lt;br /&gt;
  val=x**y&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Checked Exceptions ===&lt;br /&gt;
&lt;br /&gt;
Checked exceptions force every method to deal with (catching or throwing) all exceptions that its child calls or may call.&lt;br /&gt;
&lt;br /&gt;
'''Java''':&lt;br /&gt;
If in the program, a method calls run as follows, A1() -&amp;gt; A2() -&amp;gt; A3() -&amp;gt; A4() and if A4() throws an Exception, and it is caught by A1(), then A2(), A3() must also throw the same Exception. &lt;br /&gt;
&lt;br /&gt;
'''Python''':&lt;br /&gt;
Exceptions propagate upwards and A2() and A3() do not need to throw the Exception. &lt;br /&gt;
&lt;br /&gt;
===Duck Typing===&lt;br /&gt;
&lt;br /&gt;
Ruby doesn't care about an object's class, just whether it has a method of the name used in the method call. For this reason, the dynamic approach has earned the name duck typing. &lt;br /&gt;
&lt;br /&gt;
'''Ruby''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Duck &lt;br /&gt;
	def sound&lt;br /&gt;
         puts &amp;quot;Quack&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
Class Frog&lt;br /&gt;
	def sound&lt;br /&gt;
	 puts &amp;quot;Croak&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
def noises(duck)&lt;br /&gt;
 duck.sound&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
duckA=Duck.new&lt;br /&gt;
frogB=Frog.new&lt;br /&gt;
&lt;br /&gt;
noises(frogB)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Result''':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;quot;Croak&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=='''Project Environments Suited to Each'''==&lt;br /&gt;
&lt;br /&gt;
Python is useful for rapid prototyping, [http://en.wikipedia.org/wiki/Scripting_language Web Scripting], [http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;amp;id=18238 XML processing], database applications, [http://en.wikipedia.org/wiki/Graphical_user_interface GUI applications], scientific computations. Python can be used for large and complex software systems. YouTube, for instance, runs mainly on Python, and it is preferred language at organizations including Google, NASA and Industrial Light and Magic. Specialized Python libraries and frameworks exist for scientific programming, data manipulation, Web services, XML interchange and many other things.&lt;br /&gt;
&lt;br /&gt;
Ruby is useful for typical scripting language applications such as text processing and [http://searchsoa.techtarget.com/sDefinition/0,,sid26_gci212571,00.html middleware programs]. It is suitable for small, ad-hoc scripting tasks that previously may have been solved with Perl. Ruby has first-class [http://www.zytrax.com/tech/web/regex.htm regular expressions], which makes text processing scripts easy to write. Ruby is also suitable for larger software systems. It’s most successful application is in the [http://en.wikipedia.org/wiki/Ruby_on_Rails Ruby on Rails] web framework. Websites like Twitter and Hulu use the Ruby on Rails [http://en.wikipedia.org/wiki/Web_application_framework web development framework] in production environments.&lt;br /&gt;
&lt;br /&gt;
Ruby can also be used as a high-level [http://www.pcmag.com/encyclopedia_term/0,2542,t=API&amp;amp;i=37856,00.asp API] [http://www.knowlesys.com/articles/web-data-extraction/wrapper_definition.htm wrapper] (or domain-specific language) around some C library. Other uses for Ruby is in test/behavior driven development and when you need to create an &amp;quot;internal&amp;quot; domain-specific language.&lt;br /&gt;
&lt;br /&gt;
=='''References'''==&lt;br /&gt;
&lt;br /&gt;
*[http://ruby.about.com/od/beginningruby/a/WhatIsRuby.htm What Is Ruby?]&lt;br /&gt;
&lt;br /&gt;
*[http://blog.ianbicking.org/ruby-python-power.html Ruby, Python, &amp;quot;Power&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
*[http://python.about.com/od/gettingstarted/ss/whatispython_3.htm What is Python?]&lt;br /&gt;
&lt;br /&gt;
*[http://johan.kiviniemi.name/blag/ruby-vs-python/  Ruby vs. Python Johan Kiviniemi's series of tubes]&lt;br /&gt;
&lt;br /&gt;
*[http://en.wikipedia.org/wiki/Ruby_(programming_language) Ruby (programming language)]&lt;br /&gt;
&lt;br /&gt;
*[http://www.c2.com/cgi/wiki?PythonVsRuby Python Vs Ruby]&lt;br /&gt;
&lt;br /&gt;
*[http://www.zdnetasia.com/techguide/webdev/0,39044903,62057667,00.htm Making the case for dynamic languages]&lt;/div&gt;</summary>
		<author><name>Mpadaka</name></author>
	</entry>
</feed>