<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dev @ Work &#187; architecture</title>
	<atom:link href="http://www.devatwork.nl/tag/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devatwork.nl</link>
	<description>A day in the life of a developer</description>
	<lastBuildDate>Tue, 18 Oct 2011 16:32:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Asynchronous Payment Provider Implementation Pattern</title>
		<link>http://www.devatwork.nl/2009/03/asynchronous-payment-provider-implementation-pattern/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asynchronous-payment-provider-implementation-pattern</link>
		<comments>http://www.devatwork.nl/2009/03/asynchronous-payment-provider-implementation-pattern/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 19:27:13 +0000</pubDate>
		<dc:creator>Trilobyte</dc:creator>
				<category><![CDATA[Patterns]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Liones]]></category>

		<guid isPermaLink="false">http://www.devatwork.nl/?p=435</guid>
		<description><![CDATA[Today at Liones I started working on the integration of a payment service provider (PSP) for a web shop implementation. While I was thinking about the architecture I discovered that it is actually very straightforward and that most of the application flow is reusable in different implementations with other PSPs. Take a look at the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.devatwork.nl/wp-content/uploads/2009/03/payment400x300.jpg" rel="lightbox[435]"><img class="size-full wp-image-437 alignleft" title="Payment" src="http://www.devatwork.nl/wp-content/uploads/2009/03/payment400x300.jpg" alt="Payment" width="192" height="144" /></a>Today at <a title="Liones, het Internetbureau voor Uitgevers" href="http://www.liones.nl">Liones</a> I started working on the integration of a payment service provider (PSP) for a web shop implementation. While I was thinking about the architecture I discovered that it is actually very straightforward and that most of the application flow is reusable in different implementations with other PSPs.</p>
<p>Take a look at the UML diagram below; you will notice that there are actually two flows:</p>
<ul>
<li>One synchronous, which guides the user trough the payment screen</li>
<li>One asynchronous, which notifies when the payment state changed (payment is confirmed or canceled)</li>
</ul>
<p><span id="more-435"></span><a href="http://www.devatwork.nl/wp-content/uploads/2009/03/payment-flow.png" rel="lightbox[435]"><img class="size-full wp-image-443 alignright" title="Payment Flow" src="http://www.devatwork.nl/wp-content/uploads/2009/03/payment-flow.png" alt="Payment Flow" width="250" height="337" /></a></p>
<p><strong>Synchronous flow</strong></p>
<p>A said: the synchronous flow guides the user through the confirmation, payment and thank you steps. The following steps are taken:</p>
<ol>
<li>A record is created to track the status of the payment for the order that is being made.</li>
<li>The user is redirected to the payment provider page, this can be done using various methods including HTTP GET and HTTP POST. One of the parameters is the ID of the payment record. The other parameters depend on the PSP and might include a message signature, a merchant ID or a redirect URL for example.</li>
<li>The user fills in his credit card information, IDEAL information or any other payment information supported by the PSP. Once the user has filled in that info, the PSP processes the payment and redirects the user back to the web shop application, usually with some confirmation information, like: status (failed, in processes) and a transaction ID, in the parameters.</li>
<li>The web application stores the transaction ID in the payment record and shows the thank you text to the user.</li>
</ol>
<p>That is it for the synchronous flow.</p>
<p><strong>Asynchronous flow</strong></p>
<p>The asynchronous flow, often called notification flow, is used to give the web shop status updates about the payments. This asynchronous flow is needed because a payment might take several days or even weeks to complete. For instance: when a user pays by transferring money into a designated bank account he/she usually has two weeks to do so. The asynchronous flow can be initiated by either the PSP or the web shop depending on the specific PSP implementation.</p>
<p>The single purpose of the asynchronous flow is to update the payment identified by either the payment ID (generated by the web shop) or the transaction ID (generated by the PSP). Once a payment status has been updated the asynchronous flow could send a mail to the user to inform him/her that the payment is complete.</p>
<p><strong>Conclusion</strong></p>
<p>Although the implementation specifics vary between PSP, the general flow as described above is pretty consistent for PSPs. I hope you can integrate a PSP with your web shop in the same way, if not please let me now: this pattern needs a revision.</p>

	Tags: <a href="http://www.devatwork.nl/tag/architecture/" title="architecture" rel="tag">architecture</a>, <a href="http://www.devatwork.nl/tag/liones/" title="Liones" rel="tag">Liones</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.devatwork.nl/2009/03/asynchronous-payment-provider-implementation-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python, without using Python</title>
		<link>http://www.devatwork.nl/2008/08/python-without-using-python/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-without-using-python</link>
		<comments>http://www.devatwork.nl/2008/08/python-without-using-python/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 19:19:01 +0000</pubDate>
		<dc:creator>Trilobyte</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://www.devatwork.nl/?p=178</guid>
		<description><![CDATA[Today I faced a problem at work: I had to come up with a flexible, extendable architecture for a XML-RPC client service application. Both the client and server code had to be integrated into existing applications which makes the impact of introducing new message handlers painful if not designed properly. While thinking about those requirements [...]]]></description>
			<content:encoded><![CDATA[<p>Today I faced a problem at work: I had to come up with a flexible, extendable architecture for a XML-RPC client service application. Both the client and server code had to be integrated into existing applications which makes the impact of introducing new message handlers painful if not designed properly.</p>
<p>While thinking about those requirements I quickly thought of a concept I saw in Python: Try to call find a callable method, otherwise do the default action. In Python you can use &#8216;getattr(&#8230;)&#8217; to get a possible method of a class and with &#8216;callable(&#8230;)&#8217; you can check if the method is actually a method.</p>
<p>You get something like this on your dispatcher object:</p>
<pre class="brush: python; title: ; notranslate">def Dispatch(self, methodName, arguments=None)
   method = getattr(self, methodName, None)
   if callable( method ): method( arguments )</pre>
<p>I implemented this extensible architecture in exactly the same way. It was fairly easy to do, painless and it is extensible.</p>
<p>Learning multiple programming languages/concepts pay off!</p>

	Tags: <a href="http://www.devatwork.nl/tag/architecture/" title="architecture" rel="tag">architecture</a>, <a href="http://www.devatwork.nl/tag/python/" title="Python" rel="tag">Python</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.devatwork.nl/2008/08/python-without-using-python/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Onion Architecture</title>
		<link>http://www.devatwork.nl/2008/08/the-onion-architecture/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-onion-architecture</link>
		<comments>http://www.devatwork.nl/2008/08/the-onion-architecture/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 17:42:50 +0000</pubDate>
		<dc:creator>Trilobyte</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://www.devatwork.nl/?p=152</guid>
		<description><![CDATA[One of the key problems in software development, especially framework development, is finding a flexible and future proof architecture. The architect basically needs to have a crystal ball to see the future. There are some techniques and development choices which can reduce the costs of change but it is inevitable that you will hit a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the key problems in software development, especially framework development, is finding a flexible and future proof architecture. The architect basically needs to have a crystal ball to see the future. There are some techniques and development choices which can reduce the costs of change but it is inevitable that you will hit a limit eventually.</p>
<p>In this post I am going to talk about 1 architectural pattern which can extend the lifetime of a framework significantly. That pattern is the ‘Onion Architecture&#8217;.</p>
<p><span id="more-152"></span></p>
<p>The ‘Onion Architecture&#8217; is a pattern originally composed by ‘<a title="Jeffrey Palermo" href="http://jeffreypalermo.com/">Jeffrey Palermo</a>&#8216; and it basically says: put the conceptual model and services in the inner most layer and provide the implementation for the conceptual model and services in the outer layers together with the user interface, data access layer and other implementation details which are subject to change.<br />
The further away from the core a layer is, the more likely it is to change and the easier to change.</p>
<p>A layer in the ‘Onion Architecture&#8217; can interact to any layer below it, including the core. However, it can&#8217;t interact to any layer above it. This guarantees that more outer layers can be changed without the need to change an inner layer.</p>
<p>One important detail is that a layer isn&#8217;t the same as one component. Each layer can contain multiple components, like the image below demonstrates:</p>
<p style="text-align: center;"><img class="size-full wp-image-154 aligncenter" title="the onion architecture" src="http://www.devatwork.nl/wp-content/uploads/2008/08/onion-architecture.png" alt="The Onion Architecture" width="366" height="259" /></p>
<p style="text-align: center;">Thanks to Jeffrey Palermo for this image</p>
<p>In short, the ‘Onion Architecture&#8217; allows you to:</p>
<ul class="unIndentedList">
<li> Effectively and logically separate concept from implementation.</li>
<li> Create a dynamic and future proof architecture.</li>
<li> Replace outdated or ‘rotten&#8217; layers.</li>
<li> Introduce new components to layers without changing the inner layers</li>
</ul>
<p>That is it for now; I hope this post gives you a better insight in how to prepare your architecture for change and extendibility. If you have any question please feel free to ask them!</p>
<p><strong>Sources</strong></p>
<ul>
<li><a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-1/">http://jeffreypalermo.com/blog/the-onion-architecture-part-1/</a></li>
<li><a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-2/">http://jeffreypalermo.com/blog/the-onion-architecture-part-2/</a></li>
<li><a href="http://jeffreypalermo.com/blog/the-onion-architecture-part-3/">http://jeffreypalermo.com/blog/the-onion-architecture-part-3/</a></li>
</ul>

	Tags: <a href="http://www.devatwork.nl/tag/architecture/" title="architecture" rel="tag">architecture</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.devatwork.nl/2008/08/the-onion-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

