<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Architecture</title>
        <link>http://geekswithblogs.net/elinden/category/8192.aspx</link>
        <description>Architecture</description>
        <language>en-US</language>
        <copyright>Evan Linden</copyright>
        <managingEditor>elinden@charter.net</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Application Processing Isolation Welcome the AppDomain Object</title>
            <link>http://geekswithblogs.net/elinden/archive/2008/09/12/application-processing-isolation-welcome-the-appdomain-object.aspx</link>
            <description>&lt;p&gt;If you have ever had the need to isolate a task because it might bring down your applciation? You want to execute a task that needs a specific security context. You want isolate the task and its data. Well the AppDoamin is your new best friend. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Beginning &lt;/strong&gt;&lt;strong&gt;at the&lt;/strong&gt; &lt;strong&gt;beginning&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;To better understand .Net's AppDomain and how they affect the programs we create and work on, it'll be a good idea to start ground up. So let's start from the point we button click an application. Whenever we start an application, we're actually starting a Win32 process and running our application inside it. These processes use resource such as memory, objects, kernel so on and so forth. All processes process contains at the least one thread and if we are to run other tasks or open up other applications through our application, these tasks will belong to our particular Win32 process running on a collection of multiple threads. For WinForms applications the effect of this when executing on the UI thread can be seen when we make direct calls to long running processes. In that cause the screen to appears to lock up or become non responsive (enter the hourglass), this is also symptomatic of pre AJAX enanbled web applications. One of the cornerstones of a Win32 process is that it is very much like a closed room in your house. It's pretty easy to communicate within the room but the ability to communicate with those inthe room next to you or down the hall is problomatic. To interact with other Win32 processes, we would require some special mechanisms to work on as there are a couple of security contexts we would have to take into consideration and also the need to restrict what a Win32 process can and should given a particular set of circumstances.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;&lt;br /&gt;
Consider the lowly desktop/ laptop in any given session at our workstations we are hosting 10's or hundreds of processes. Often we are not even aware of the wide array of processes that are working diligently on our behalf to keep the system running. Lets break down exactly what's happening in the scenario. Stepping away from the concerns of what variables are being used and how many may have the same name and who writes efficient software vs.... &lt;em&gt;well enough said&lt;/em&gt; what are we really talking about to keep the engine running. At the crux of the issue what we're actually dealing with and what we would have to provide to these applications - Resources, resources and even more resources! The primary resource we are talking about is memory running a close second are security issues; therefore it is imperative that we force absolutely no communication of any sort between the processes of these applications. Wait what's the point of having a computer and all these applications if they can talk to each other. Ah the exception to the rule, there are frequent exceptions based on requirements, so many exceptions that perhaps that should be the RULE. Invoking these exceptional cases can and often does  lead to frequent crashes. the instance where one process using up the memory allocated to another process can lead to unstable environments that eventually CRASH! I hate it! Everyone hates it!  Especially customers. Anyway, our process dies,blows up, dies an unnatural death ect.. Nothing new it happens we are human after all not machines. These frequent crashes and run-time errors are usually caused due to inefficient use of memory leading to memory leaks, null object referencing, out of memory bounds you get the idea. From this example it becomes clear that running and maintaining processes are VERY expensive on a single workstation not to mention the effect this would have on oh say an App server or a Web server serving up several thousand web sites. Hence, It just isn't a good idea to use a large number of processes since they simply do not scale pretty well. So here's a pretty neat solution that was employed for the above situation. Running a host of multiple applications within a single process will enable us to use fewer resources enter the Web Server  code name IIS. This would even result to faster execution. But here's another everyday scenario: in the case where one application crashes, every other application within this process goes down like a deck of cards! OUCH !! Who did that. And we wonder why system administrators are so protective of their servers?&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A New Paradigm&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Enter the .Net AppDomain. The main purpose of an Application Domain is to isolate our applications from other applications. Application domains run on a single Win32 process. The same solution that we just mentioned above can use an application domain and at the same time, limit the possibility of errors and crashes due to memory leaks while providing isolation, security context and protection of our application from other applications. &lt;br /&gt;
Hence we're running an application within an application domain and we further run multiple application domains within a single Win32 process. With the CLR's ability to run managed code, we're further cutting down on leaks and crashes. Objects in the same Application Domain communicate directly while Objects that exists in different Application Domains interact with each other by transporting copies of objects to each other or by using proxies for message exchange (by reference). &lt;br /&gt;
So that's the crux of an Application Domain. &lt;/p&gt;
&lt;p&gt;Ah but theres more - It's actually a pretty neat light weight process that runs within a single Win32 process. Infact, as previously noted, we can run multiple Application Domains within a single Win32 process and much like Russian Nesstign Dolls &lt;a href="http://www.goldencockerel.com/shoprussian.asp?object=store&amp;amp;id=102031"&gt;&lt;img alt="Inexpensive Russian Nesting Doll" border="0" src="http://www.goldencockerel.com/images/s_102031_a.jpg" /&gt;&lt;/a&gt;Domains inside of Domains.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Why would I want to do that?&lt;/em&gt; Another advantage of using an Application Domain is that we can destroy it through the parent without affecting other Application Domains that exist within that Win32 process. Therfore we can extrapolate that any work occuring in that Application Domain can be independent. &lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;Bonus Features &lt;/strong&gt;&lt;/font&gt; We can also use Application Domains to unload types by destroying the Application Domain that we have loaded it into- support for dynamicloading and unloading . The amazing .Net runtime enforces Application Domain isolation by ensuring control over memory use and therefore all the memory that is used by the Application Domains within a Win32 process is managed by the .Net runtime. &lt;em&gt;(Read no heavy lifting on your part)&lt;/em&gt; We are avoiding almost all the problems that we mentioned initially such as one application accessing another application's memory and hence avoiding runtime errors followed by crashes. What we have actually done is provide a secure execution context that isolates current applications from talking to other applications. Practically speaking, Application Domains play a critical security and functional role especially when we're creating applications that do remoting like running web services. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Now how do we create a basic application domain? &lt;br /&gt;
&lt;/strong&gt;A basic AppDomain issimplicity itself. The .Net framework provides a beautiful base class that exists within the System namespace so that we can explicitly create an AppDomain. Inheriting the System.MarshalByRefObject base class into our applications, we can create objects that communicate between and across different application domains. &lt;br /&gt;
Here is a simple application to create an AppDomain in C#. &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
 &lt;a atomicselection="true" href="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image010.png"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="508" width="789" border="0" alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image0_thumb6.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;a atomicselection="true" href="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image08.png"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="385" width="668" border="0" alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image0_thumb4.png" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The output the program creates is shown below &lt;/p&gt;
&lt;p&gt;&lt;a atomicselection="true" href="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image017.png"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="146" width="677" border="0" alt="" src="http://geekswithblogs.net/images/geekswithblogs_net/elinden/WindowsLiveWriter/ApplicationProcessingIsolationWelcomethe_F16D/image0_thumb9.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;a rel="tag" href="http://technorati.com/tag/better%20known%20framework"&gt;Better Known Framework&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125133"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125133" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elinden/aggbug/125133.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>elinden</dc:creator>
            <guid>http://geekswithblogs.net/elinden/archive/2008/09/12/application-processing-isolation-welcome-the-appdomain-object.aspx</guid>
            <pubDate>Fri, 12 Sep 2008 15:41:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elinden/comments/125133.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elinden/archive/2008/09/12/application-processing-isolation-welcome-the-appdomain-object.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elinden/comments/commentRss/125133.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elinden/services/trackbacks/125133.aspx</trackback:ping>
        </item>
        <item>
            <title>Green Computing- Software for a Green Landscape</title>
            <link>http://geekswithblogs.net/elinden/archive/2008/06/09/green-computing--software-for-a-green-landscape.aspx</link>
            <description>&lt;p&gt;A friend of mine &lt;a href="http://blog.dennyboynton.com/"&gt;Denny Boynton&lt;/a&gt; and I were talking at TechEd last week about green computing and it started me thinking. He mentioned that he and some other architects were discussing green computing platforms (server vitalization, cloud computing,etc...). That started me talking about: What is the responsibility of the software developer in this emerging green computing grid? Many infrastructure groups over the last few years have been moving to virtual servers and environments initially to save on capital expenditures slow the ever growing demand for data center real estate.&lt;/p&gt;
&lt;p&gt;Now after establishing the foundation for vitalization operations groups are seeing tertiary benefits form this process. Additional, justifications now include floor space reduction, reduced energy consumption, and  energy savings from cooling requirements for data centers. Operational support teams are encouraging app dev teams to move their custom applications to these virtual instances and if necessary to modify applications that are not compatible to leverage this ROI for the company. The primary sales points given to App Dev teams are assurance that all servers are identical and the added speed that operations groups can scale out to support. Generally there are significant advantages to this trend towards vitalization, reduced surface space, reduced capital expense, lower maintenance cost, lower energy costs, higher reliability and scalability definitely a WIN WIN. That said how do we ensure that this continues to be a wining proposition.&lt;/p&gt;
&lt;p&gt;What is the responsibility of the software developer in this new landscape? How can we ensure that this trend continues. I have developed and designed architecture for software for the last several decades. Over that time period I have increasingly heard comments like "we will just get more servers" and "memory is cheap" have become all to common. That along with approaches to application development that involve wide and deep data structures because "we don't want to go back to the server" for the data later, because we are lazy and don't want to make the extra call bloat our applications. Approaches and architectures like this will never preserve these new found savings we have found. We must change our approach to applications development. We should not avoid taking the extra steps necessary to ensure that we minimize our server footprint. Thoughtful design and architecture that ensures features are delivered to applications without excessive round trips to servers or the transmission of additional unnecessary data overhead are initial steps we can take. As developers should actively look to new technologies to improve user experience and reduce custom and non standard communications channels. In the .Net development space we should pursue WPF, WCF and Silverlight technologies to reduce the complexity of future applications. We should also actively review and seek opportunities to exit from legacy non mainstream Microsoft platforms. Finally, we need to proactively lobby vendors to include the features that support that enables developers to concentrate on productive business functionality and less of plumbing applications and injecting potentially faulty, difficult to maintain code that tightly ties applications to their deployment paths and infrastructure.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;a href="http://technorati.com/tag/architecture" rel="tag"&gt;Architecture&lt;/a&gt; &lt;a href="http://technorati.com/tag/best%20practice" rel="tag"&gt;Best Practice&lt;/a&gt; &lt;a href="http://technorati.com/tag/programming" rel="tag"&gt;Programming&lt;/a&gt; &lt;a href="http://technorati.com/tag/design" rel="tag"&gt;Design&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122750"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122750" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elinden/aggbug/122750.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>elinden</dc:creator>
            <guid>http://geekswithblogs.net/elinden/archive/2008/06/09/green-computing--software-for-a-green-landscape.aspx</guid>
            <pubDate>Tue, 10 Jun 2008 02:55:21 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elinden/comments/122750.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elinden/archive/2008/06/09/green-computing--software-for-a-green-landscape.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elinden/comments/commentRss/122750.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elinden/services/trackbacks/122750.aspx</trackback:ping>
        </item>
        <item>
            <title>When is Enough Enough – What is an Architect?</title>
            <link>http://geekswithblogs.net/elinden/archive/2008/06/04/when-is-enough-enough--what-is-an-architect.aspx</link>
            <description>&lt;div style="MARGIN: 0in 0in 0pt"&gt;I have spent the better part of the last three days in sessions at Microsoft TechEd listening to folks talk about: What is an architect? How do we identify them? Are they born or taught? Are there good architects and bad architects, what differentiates them? Why are architects seen as &lt;em&gt;“a necessary evil”&lt;/em&gt; are they just overhead. What do they contribute?  I apologize in advance for the lengthiness of this post but this is a core value point to me and I tend to get very wordy when an issue is near and dear to my heart.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt; &lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;The Why of it all - I don’t know, what are we really asking&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;Why are we asking this question? Are we trying to justify our existence? Are we trying to improve our profession?  Is it a role or a title maybe both why do we care? Are we experiencing a midlife identity crisis?  Or is it just growing pains? How many people in other positions do you know that are questioning: Who am I: What do I do? I have heard many definitions of an architect over the last few days ranging from software police to conductor and artist. If there was ever a career field in catatonic crisis this is it. Unfortunately I also feel compelled to offer up a definition of IT architect. While I could not come up with a single word analogy to describe or be synonymous with architect lets try a long winded definition. After all what we do &lt;strong&gt;&lt;u&gt;is important&lt;/u&gt;&lt;/strong&gt; aren’t we worth more than a single word.  I suspect that few if anyone will like my definition but most will likely identify it as true.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Architect Defined in General&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;The &lt;strong&gt;&lt;em&gt;architect&lt;/em&gt; &lt;/strong&gt;defined - On a product development effort anyone who makes a decision that materially affects the financial cost, business value, technical infrastructure or technical implementation or direction is by default an architect making architecturally significant decisions and is acting in the architect role. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;The Reality of it all – Often we just aren’t Empowered&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;This may or may not be “The Architect” who generally is the person anointed by someone, on high in a position of power, to be responsible for the architecture artifacts. In fact I would submit to you that in most cases the architect on projects is rarely The Architect and there in lies our problem. There is not a clear identification of roles and responsibilities along with the power to veto. Everyone is an architect because throughout the SDLC each individual contributor more likely falls within the scope defined above at some point. From the Customer, Project Manager, Sr. Developer to the developer and lets not forget management in general.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Civil/Architectural Architects vs. Software Architects (Case Study)&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;As a simple non scientific case study let’s compare the civil architect to the software architect. Perhaps in examining why civil architects are successful we can glean a perspective into where our real problem lies.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;On software development efforts unlike construction projects the power of veto for how things get built almost always lies with the plurality of those with the money and those managing the money. It is the reverse on a construction project the final say as to how to build the bridge, road or house is ultimately in the hands of THE ARCHITECT. Does he work within constraints financial and time related sure. Scope budget and time are ever present in almost any undertaking that requires developing / building something. This is because it is understood and accepted that the civil architect is the expert in the rules, code and laws regarding construction and more likely than not specializes in the specific domain in question. He is the de-facto expert on form function design and codification for the project and all acknowledge that.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;So why is the civil/architectural architect so much more powerful than the software architect? The answer is simple: it has little to do with power and more to do with empowerment. Civil and architectural architects have been sanctioned and empowered with the responsibility by others outside of the project. These people insist the architect take responsibility for the design and direction. Don’t think for a moment that there are not carpenters, concrete workers, brick layers and others out there saying, “this is crazy why do it this way I know how to do it better”. They are there but I can guarantee you that none of them are willing to deviate from the blueprints handed down from the ARCHITECT. That is because the customer, the financier and the state insist that they have empowered the architect to design and architect the appropriate and safe direction for the construction of the bridge, road or house.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;An Architects view on Architects&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;A good friend of mine who works for Microsoft and fellow architect (Denny Boynton) recently wrote an interesting blog on &lt;a href="http://blog.dennyboynton.com/post/Monty-Python-and-quot3bThe-Role-of-the-Architectquot3b.aspx"&gt;The Role of the Architect&lt;/a&gt;. In this article he poses that there are many forces exerted on the software architect both internal and external to the project. In the face of these forces it is the fundamental role of the architect to blend technical capabilities, business needs and corporate cultural factors into a “Best Fit” solution for the circumstances. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;In short the job of the architect is to understand the customer needs, business value, technical and operational landscape and weight these factors appropriately against the corporate and IT strategy to determine the correct course of action. He also notes that t is not the role of the architect to become embroiled in the “religious wars” that erupt around technology. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;While I concur that religious zeal around technology is not appropriate in the context of defining a project’s technical direction. I disagree that it is the role of the architect to avoid or shun those technology conflicts. Unwillingness on the architect’s part to wade into the fray and shout above the fray “Follow Me” is an abandonment of his responsibility to provide guidance and direction in his area of expertise and to make sound judgments for the technical direction of his organization. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;The fact that “religious wars” are even taking place brings into question the abilities of the architect. At the core one of the fundamental duties of the architects’ is to provide the vision for the implementation, adopting and exit strategy for technologies within the corporate framework. Additionally, justification is needed identifying how they relate to the corporate business and IT strategy. It is also the responsibility of the architect to provide a clear and concise vision of how technologies are to be used for business value and how that also relates to the corporate bottom line. In this light the development and management community should no longer have a need or desire to engage in “religious wars” as everyone can clearly see how technology is to be leveraged for business benefit. At worst there should only be minor skirmishes around the overlapping areas of the capability models that can easily be resolved. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Types of Architects&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;From my comfortable armchair I look out on the domain that is information technology and see that we go to great lengths to differentiate the numerous types of architects as if therein lies the ability to rank them. There are no less that 12 types I can think of off the top of my head no doubt you can think of many more:&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Enterprise&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Solution&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Application&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Data&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Integration&lt;/em&gt; Architect &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Infrastructure&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;SAP &lt;/em&gt;Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Microsoft&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Java&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Data Warehouse&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Domain&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;em&gt;Network&lt;/em&gt; Architect&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;As you look at these title/roles, daily hats you wear you may notice that they all have one thing in common the word ARCHITECT. The word architect in each of these roles is the noun the word(s) immediately prior is the adjective enhancing and adding specialization to describe the type of architect. In the end we are all architects and as such should be able to define a common set of activities, goals and actions that define us. I would submit that in the final analysis there are really three kinds of architects&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Empowered Architects&lt;/strong&gt; – Those who are given the power to effect change within the enterprise domain or problem space.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Consulting Architects&lt;/strong&gt; – Those who provide recommendations and best practices direction only, but cannot effect change.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Ad Hoc Architects&lt;/strong&gt; – Those who in the absence of empowered architects make decisions based on the problem presented to them irregardless of the enterprise domain or problem space.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Final Observations&lt;/strong&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;In closing let me posit that the real issue that plagues our profession is not; what is an architect or even who should be an architect? No matter what criteria we place on the table as the hurdle to overcome there will always be good bad and indifferent architects just as there are good bad and indifferent teachers, doctors lawyers, CEO’s …. What we are missing are the certifications, standards, and characteristics that define what makes an architect and architect. You do not grow up to be an architect by putting in your time as a developer and graduate to architect by virtue of time in service or it’s the next promotion step. I contend that we can fairly easily identify common actions, traits and disciplines that are indicative of the people we what to give the title and role of Architect to. I provide those listings below for all to consider as my closing words on “What is an Architect”. I will leave the measurement and certification question to another day as it is much more politically charged even than this question.&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Actions that indicate Someone is an Architect&lt;/strong&gt;&lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in" type="disc"&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They consider the enterprise, business and technology landscape when crafting and directing the solution so that it adds business value while reducing impact to the core infrastructure. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They refrain from engaging in the defeatist arguments of technology bigotry while striving to seek a middle ground and achieve a balance of technologies in the enterprise. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They are the consummate politician employing all of the strategies of negotiation and influence to achieve goals that further the companies’ strategic objectives through the use and application of all technologies in their arsenal. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;There are above all scholars and teachers of the discipline of architecture exuding a desire to foster better understanding among their peers and others they council and provide guidance too. The hunger for knowledge and actively seek out opportunities to broaden their technical portfolio. &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.25in"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Traits that Identify Someone as an Architect&lt;/strong&gt;&lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in" type="disc"&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They understand and support technology decisions based on a process that maintains a holistic view of the applications, solutions platforms, and business processes that enable the achievement of business goals. Planning the future technologies based on alignment to business strategic goals. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;The embrace Architecture as the discipline of thinking and planning how Information Technology implementations will support business strategies now and in the future with the least amount of friction &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They accept responsibility for developing, maintaining and envisioning the technology direction that best enables the priority business activities of their company and facilitates the adaptation of technology to the changing business needs. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They work with business units, application development and IT Operations to ensure current, short and long term goals are being realized. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;They foster architectures that include the frameworks, networks, deployment configurations, domain architecture, and supporting infrastructure that form the technical architecture for the enterprise. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;While they specialize in one particular technical area, they must always maintain currency in each of the core disciplines. Without this broad general knowledge, they will be unable to design effectively, as problems and opportunities will not be evident. &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.25in"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Disciplines&lt;/strong&gt;&lt;/div&gt;
&lt;ul style="MARGIN-TOP: 0in" type="disc"&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Business Strategy.&lt;/strong&gt;The role of IT is to make businesses more successful in meeting their strategic goals. An Architect must be able to understand those goals as expressed by the client, and translate them into winning IT strategies. The role of the Architect is not to help the client develop their strategy, but to help the client execute it with technology, process and IT operations as leverage points to deliver strategic value.&lt;strong&gt; &lt;/strong&gt; &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Financial Management.&lt;/strong&gt;The Architect must be able to analyze, in more than a superficial way, the financial impact of current operations and of proposed changes. The Architect’s job is to show senior management how to evaluate the options presented from an investment point of view.&lt;strong&gt; &lt;/strong&gt; &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;&lt;strong&gt;Business Process Design.&lt;/strong&gt;The Architect must carefully consider business processes as part of the design process; after all, the goal is to make the processes more effective and (usually) less costly. Without understanding how to think of business processes, and how to change them, the architect will be unable to go beyond the level of talented craftsman. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;&lt;span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;Organizational Dynamics.&lt;/strong&gt; Frequently technology deployments fail because of inadequate consideration of the effects of the change on organizations. Organizations tend to evolve, and at any given moment most organizations will reflect the hard-learned lessons of the last generation of technology. The challenge for the Architect is to help make the transition to new designs in such a way that the new design can be managed by the changed organization, and that the financial benefits predicted can indeed be obtained. &lt;/li&gt;
    &lt;li style="MARGIN: 0in 0in 0pt"&gt;&lt;span&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;strong&gt;Information Technology.&lt;/strong&gt;Without a firm grasp of all areas of information technology, the Architect is doomed to mediocrity. The Architect must understand application design, the Internet technologies, database and data warehouse design, network design, and the many other aspects of information technology at a thorough, cross disciplinary level. &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="MARGIN: 0in 0in 0pt 0.25in"&gt; &lt;/div&gt;&lt;p&gt; &lt;/p&gt;
&lt;a rel="tag" href="http://technorati.com/tag/architecture"&gt;Architecture&lt;/a&gt; &lt;a rel="tag" href="http://technorati.com/tag/architecture"&gt;Design&lt;/a&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122627"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122627" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elinden/aggbug/122627.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>elinden</dc:creator>
            <guid>http://geekswithblogs.net/elinden/archive/2008/06/04/when-is-enough-enough--what-is-an-architect.aspx</guid>
            <pubDate>Thu, 05 Jun 2008 04:26:52 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elinden/comments/122627.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elinden/archive/2008/06/04/when-is-enough-enough--what-is-an-architect.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/elinden/comments/commentRss/122627.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elinden/services/trackbacks/122627.aspx</trackback:ping>
        </item>
        <item>
            <title>Using Interfaces - Design by Contract</title>
            <link>http://geekswithblogs.net/elinden/archive/2008/06/03/using-interfaces---design-by-contract-again.aspx</link>
            <description>&lt;dd class="Text"&gt;
&lt;p&gt;&lt;strong&gt;An argument for Interface based design and programming&lt;/strong&gt;&lt;br /&gt;
For software to survive in the ever-changing jungle of the production environment, it must have three distinct characteristics: reusability, maintainability, and extensibility.&lt;br /&gt;
Interface-based programming exists outside the world of COM. It is a programming discipline that is based on the separation of the public interface from implementation. It was pioneered in languages such as C++ and Smalltalk by software engineers who discovered that using distinct interfaces could make their software, especially large applications, easier to maintain and extend. The creators of Java saw the elegance of interface-based programming and consequently built support for it directly into their language.&lt;br /&gt;
Interfaces solve many problems associated with code reuse in object-oriented programming. This document will discuss what some of these problems are. In particular, when you program in a style consistent with classic OOP, a client can build inflexible dependencies on a class definition. These dependencies can make it difficult to maintain or extend the class without breaking the client. It becomes tedious or impossible to improve the code for an object over time. Certain problems are also associated with a popular OOP language feature known as implementation inheritance. This powerful but often misused feature is vulnerable to similar dependency problems, which compromise an application's maintainability and extensibility. Since most &lt;a my_onclick="null" href="http://en.wikipedia.org/wiki/Third-generation_programming_language"&gt;&lt;font color="#014982"&gt;3GL&lt;/font&gt;&lt;/a&gt; languages support implementation inheritance, this document will discuss its strengths and limitations in order to address some of the problems that interface-base programming was created to solve. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Separating the Interface from the Implementation&lt;br /&gt;
&lt;/strong&gt;Object composition offers another way to achieve reuse without the tendency toward tight coupling. Object composition is based on black-box reuse, in which implementation details of a class are never revealed to the client. Clients know only about an available set of requests (the what). Objects never expose internal details of the response (the how).&lt;br /&gt;
Black-box reuse is based on formal separation of interface and implementation. This means the interface becomes a first-class citizen. An interface is an independent data type that is defined on its own. This is an evolution of classic OOP, in which a public interface is defined within the context of a class definition.&lt;br /&gt;
At this point, you are probably thinking that this is all pretty vague. You're asking yourself, "What exactly is an interface?" Unfortunately, it's hard to provide a concise definition that conveys the key concepts of an entirely new way to write software. An interface can be described in many ways. You can get up to speed pretty quickly on the syntax for defining, implementing, and using interfaces. However, the implications that interfaces have on software design are much harder for the average programmer to embrace. Learning how to design with interfaces usually takes months or years.&lt;br /&gt;
At its most basic level, an interface is a set of public method signatures. It defines the calling syntax for a set of logically related client requests. However, while an interface defines method signatures, it cannot include any implementation or data properties. By providing a layer of indirection, an interface decouples a class from the clients that use it. This means an interface must be implemented by one or more classes in order to be useful. Once an interface has been implemented by a class, a client can create an object from the class and communicate with it through an interface reference.&lt;br /&gt;
You can use an interface to create an object reference but not the object itself. This makes sense because an object requires data properties and method implementations that cannot be supplied by an interface. Because it is not a creatable entity, an interface is an abstract data type. Objects can be instantiated only from creatable classes known as a concrete data types.&lt;br /&gt;
From a design standpoint, an interface is a contract. A class that implements an interface guarantees the objects it serves up will support a certain type of behavior. More specifically, a class must supply an implementation for each method defined by the interface. When communicating with an object through an interface reference, a client can be sure the object will supply a reasonable response to each method defined in the interface.&lt;br /&gt;
More than one class can implement the same interface. An interface defines the exact calling syntax and the loose semantics for each method. These loose semantics give each class author some freedom in determining the appropriate object behavior for each method. For instance, if the IDatabase interface defines a method named ExecuteSql(string commandText), different class authors can supply different responses to the same request, as long as each somehow reinforces the concept of running a sql statement. The OracleDatabaseConnector class can implement ExecuteSql() in a different way than either MSSqlDatabaseConnector or SybaseDatabaseConnector. This means that interfaces provide the opportunity for polymorphism. Interfaces are like implementation inheritance in the sense that they let you build applications composed of plug-compatible objects. However, interfaces provide plug-compatibility without the risk of the tight coupling that can occur with implementation inheritance and white-box reuse. &lt;/p&gt;
&lt;p&gt;Note that this is an example only I am not sure I could ever justify doing this or argue that this is a good thing unless your are forced into it. I felt compelled to implement this due to usage restrictions in a corporate environment. In an effort to foster reuse (&lt;em&gt;topic for another time… How and when to write for reuse&lt;/em&gt;) and comply with some misinterpreted security policies a wrapper was written around .Net native Data Access to “Protect” developers from themselves and to hide database connection strings from developers at runtime in the IDE. &lt;strong&gt;DON’T ASK HOW&lt;/strong&gt;…&lt;em&gt; that’s a story for another day&lt;/em&gt;.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpMSjoEA-XVjUaCmQl78laYk7w-i-8J-rvf6TaNi6g6d5qLL4T29D2hpkTaE1RcaXi0"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="770" height="335" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpNnmdjRd-GSdQicRFUohaa8N97_ptjqfjqb9vFxVbtd2yjGG61RewpsKwieheR_fBA" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Two Faces of Inheritance&lt;/strong&gt;&lt;br /&gt;
Inheritance is an objected-oriented concept that models an "IS A" relationship between two entities. So far, this article has used the term implementation inheritance instead of the more generic term inheritance because extending a super class with a sub class is only one way to leverage an "IS A" relationship. When a class implements an interface, it also takes advantage of an "IS A" relationship. For instance, if a class OracleDatabaseConnector implements the interface IDatabase, it is correct to say that an OracleDatabaseConnector "IS A" Database. You can use an OracleDatabaseConnector object in any situation in which an IDatabase-compatible object is required.&lt;br /&gt;
Interface-based programming is founded on a second form of inheritance known as interface inheritance. This means that inheritance does not require the reuse of method implementations. Instead, the only true requirement for inheritance is that a sub class instance be compatible with the base type that is being inherited. The base type that is inherited can be either a class or a user-defined interface. In either situation, you can use the base-type references to communicate with objects of many different types. This allows both forms of inheritance to achieve polymorphism.&lt;br /&gt;
Both forms of inheritance offer polymorphism, yet they differ greatly when it comes to their use of encapsulation. Implementation inheritance is based on white-box reuse. It allows a sub class to know intimate details of the classes it extends. This allows a sub class to experience implicit reuse of a super class's method implementation and data properties. Implementation inheritance is far more powerful than interface inheritance in terms of reusing state and behavior. However, this reuse comes with a cost. The loss of encapsulation in white-box reuse limits its scalability in large designs.&lt;br /&gt;
As the term black-box reuse suggests, interface inheritance enforces the concepts of encapsulation. Strict adherence to the encapsulation of implementation details within classes allows for more scalable application designs. Interface-based programming solves many of the problems associated with white-box reuse. However, to appreciate this style of programming, you must accept the fact that the benefits are greater than the costs. This is a struggle for many programmers.&lt;br /&gt;
When a class implements an interface, it takes on the obligation to provide set methods. Sub class authors must write additional code whenever they decide to implement an interface. When you compare this to implementation inheritance, it seems like much more work. When you inherit from a class most of your work is already done, but when you inherit from an interface your work has just begun. At first glance, implementation inheritance looks and smells like a cheeseburger, while interface inheritance looks like a bowl of steamed broccoli. You have to get beyond the desire to have the cheeseburger to reach a higher level of interface awareness. The key advantage of interface inheritance over implementation inheritance is that it is not vulnerable to the tight coupling that compromises the extensibility of an application. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why Use Interfaces?&lt;/strong&gt;&lt;br /&gt;
When developers learn how to use interfaces in an application, they often wonder, "Why would I ever want to do that?" or "Why should I care?" Programming with class-based references seems far more natural compared to the additional complexity required with user-defined interfaces. The previous example would have been far easier if the client code programmed against public methods and properties of the OracleDatabaseConnector class instead of the IDatabase interface. User-defined interfaces seem like extra work without any tangible benefits.&lt;br /&gt;
There are several significant reasons why a programmer should care about interfaces. The first reason is that interfaces are the foundation of Services they define the contract. In a services environment clients can use class-based references but imagine the power contract based programming. Instead of class objects you access and program to their published interface the contract is immutable the objects are not. This provides a greater degree of isolation and protection from changes in the service and a high degree of flexibility through interface references. I know this sounds like the fundamentals of COM. Isn’t COM dead? Yes is died with a whimper and a cheer but the rules we lived with port directly to the WebServices and SOA enabled world. If you embrace interface-based programming, you will become a much stronger programmer.&lt;br /&gt;
Another reason why you should care about interfaces is that they can offer power and flexibility in software designs. Using interfaces in your programming becomes valuable when you don't have a one-to-one mapping between a class and a public interface. There are two common scenarios. In one scenario, you create an interface and implement it in multiple classes. In the other scenario, you implement multiple interfaces in a single class. Both techniques offer advantages over application designs in which clients are restricted to using references based on concrete classes. While interface-based designs often require more complexity, the sky is the limit when it comes to what you can do with them.&lt;br /&gt;
Consider a case in which many classes implement the same interface. For example, assume the classes CSecurityProvider, CSettingsProvider, and CNotificationsProvider all implement the interface IProvider. &lt;/p&gt;
&lt;p&gt;&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpNDr8bCEiW3z4r51_gpCEhOiQlrHKcQ-8c1MlaKgnazsgXyCVmqZF6nRuMcvX24wJU"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="412" height="233" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpOZhyIi0InEgJlw2uEJ_fAwM5ZP4XjIz5mi7KvsyGBI_cLXxm-evDsnekzquByOSok" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;An application can maintain a collection of IProvider-compatible objects using the following code: &lt;/p&gt;
&lt;p&gt;&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpM27z4c4f8Ydo8Xy0khZGnznHVsfLqFH8vklCA9RtjFBSRwPz9hDNJObPrLitCXgzY"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="513" height="104" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpPnE1yP3CC4p1SWRXhNQVEXJ8wrf2QrFK0-C1sqjNzuUiR0sRkOaunhHjBcmQNj-bA" /&gt;&lt;/a&gt; &lt;br /&gt;
Well thats neat but how is that of use? I can accomplish the same thing with a generic collection or an array of object type. Yes your right but where is the value add? How do you know what is in your generic collection or array of objects?&lt;br /&gt;
First lets assume that the interface defines a method/contract of GetData() and that an array of providers is provided in the constructor of the containing class. Lets also assume for this example that each Provider needs to call the GetData method in the constructor of the containing class. A simple for loop can be used to accomplish this for all the IProviders.&lt;br /&gt;
&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpOm048m1_KrQ1Mk9KXKTxAVVkBWv-HaXru1oim854BP6ItSLSxTyph-5nuZ8wFfiK4"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="339" height="109" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpPgQl-P1EtZMnFxumi-PVklV-eT0CVor0wUBnEUBleBmBY6YKyoCxPlayk1A5XYVBg" /&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;Another scenario could be that you only want to call the GetData method on the SecurityProvider and verify the user is authorized before continuing. Now our simple loop has become a bit more complex.There are two ways to accomplish this I would recommend the second for simplicity,elegance and clarity.&lt;br /&gt;
Example 1&lt;br /&gt;
&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpM39kBYZF00T2C9y_3GlJ1Rmmg-KeMmOR6F_OUtWvpEvJRyHCHoKjoQplJsjfEul7c"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="355" height="100" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpMawvKjTXPxGlv_ha9MF2I61t5xre4aQ5wotI2yJWMJ9fzXcUHR4NUp9CRwWOMnsjY" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Example 2&lt;br /&gt;
&lt;a my_onclick="null" href="http://byfiles.storage.msn.com/y1pwrsAjVipDpMGsv_1ZzIYrP753jJBADx3Gr876oY7wRQM1VmMFwlwQDkzIDptdpxjozAA4D4j8ak"&gt;&lt;img style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border="0" alt="" width="359" height="67" src="http://byfiles.storage.msn.com/y1pwrsAjVipDpO54b64KeVcXoQY_MvjlxuLmPNY1g_ElgGHQwdukVIEioOs9YMsvWYKkJ6iubH2fGs" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This has by no means been an exhaustive discussion of interfaces but I think you can begin to see the value and power that design by interface can bring to you applications.&lt;/p&gt;
&lt;a rel="tag" href="http://technorati.com/tag/architecture"&gt;Architecture&lt;/a&gt; &lt;/dd&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122602"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122602" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elinden/aggbug/122602.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>elinden</dc:creator>
            <guid>http://geekswithblogs.net/elinden/archive/2008/06/03/using-interfaces---design-by-contract-again.aspx</guid>
            <pubDate>Wed, 04 Jun 2008 03:17:47 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elinden/comments/122602.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elinden/archive/2008/06/03/using-interfaces---design-by-contract-again.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elinden/comments/commentRss/122602.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elinden/services/trackbacks/122602.aspx</trackback:ping>
        </item>
        <item>
            <title>Why Unit Test</title>
            <link>http://geekswithblogs.net/elinden/archive/2008/06/03/why-unit-test-again.aspx</link>
            <description>&lt;dd class="Text"&gt;
&lt;p&gt;&lt;strong&gt;Unit Testing&lt;br /&gt;
&lt;/strong&gt;In computer programming, unit testing is a procedure used to validate that individual modules or units of source code are working properly.&lt;br /&gt;
More technically one should consider that a unit is the smallest testable part of an application. In a Procedural Design a unit may be an individual program, function, procedure, web page, menu etc. But in Object Oriented Design, the smallest unit is always a Class; which may be a base/super class, abstract class or derived/child class.&lt;br /&gt;
A unit test is a test for a specific unit. Ideally, each test case is independent from the others; mock objects can be used to assist testing a module in isolation. Unit testing is typically done by the developers and not by end-users.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Systems Best Practice for Unit Testing&lt;br /&gt;
&lt;/strong&gt;Writing good unit tests is simply a best practice for application developers. When we do code reviews we do attempt to run the unit tests if they in fact exist and we note if the tests pass or fail. The tests are there for the benefit of the development team to ensure that the code functions according to the specifications delivered and to support long term maintainability.&lt;br /&gt;
I would recommends that unit tests exist for each and every public function that is accessible within the code base. This will also assist in identifying problem areas during maintenance work and ensure that once the code it developed and stable that it remains stable. It is highly recommended that unit tests be developed that exercise both the positive path and negative path to ensure that improper inputs as will as expected behavior is properly controlled.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Benefit&lt;/strong&gt;&lt;br /&gt;
The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. Unit testing provides a strict, written contract that the piece of code must satisfy. As a result, it affords several benefits.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Facilitates change&lt;/strong&gt;&lt;br /&gt;
Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (i.e. regression testing). The procedure is to write test cases for all functions and methods so that whenever a change causes a regression, it can be quickly identified and fixed. This provides the benefit of encouraging programmers to make changes to the code since it is easy for the programmer to check if the piece is still working properly. Good unit test design produces test cases that cover all paths through the unit with attention paid to loop conditions.&lt;br /&gt;
In continuous unit testing environments, through the inherent practice of sustained maintenance, unit tests will continue to accurately reflect the intended use of the executable and code in the face of any change. Depending upon established development practices and unit test coverage, up-to-the-second accuracy can be maintained.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Simplifies integration&lt;br /&gt;
&lt;/strong&gt;Unit testing helps to eliminate uncertainty in the units themselves and can be used in a bottom-up testing style approach. By testing the parts of a program first and then testing the sum of its parts, integration testing becomes much easier.&lt;br /&gt;
A heavily debated matter exists in assessing the need to perform manual integration testing. While an elaborate hierarchy of unit tests may seem to have achieved integration testing, this presents a false sense of confidence since integration testing evaluates many other objectives that can only be proven through the human factor. Some argue that given a sufficient variety of test automation systems, integration testing by a human test group is unnecessary. Realistically, the actual need will ultimately depend upon the characteristics of the product being developed and its intended uses. Additionally, the human or manual testing will greatly depend on the availability of resources in the organization.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;strong&gt;Documentation&lt;br /&gt;
&lt;/strong&gt;Unit testing provides a sort of "living document". Clients and other developers looking to learn how to use the module can look at the unit tests to determine how to use the module to fit their needs and gain a basic understanding of the API.&lt;br /&gt;
Unit test cases embody characteristics that are critical to the success of the unit. These characteristics can indicate appropriate/inappropriate use of a unit as well as negative behaviors that are to be trapped by the unit. A unit test case, in and of itself, documents these critical characteristics, although many software development environments do not rely solely upon code to document the product in development.&lt;br /&gt;
Ordinary documentation, on the other hand, is more susceptible to drifting from the implementation of the program and will thus become outdated (e.g. design changes, feature creep, relaxed practices to keep documents up to date).&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Separation of interface from implementation&lt;br /&gt;
&lt;/strong&gt;Because some classes may have references to other classes, testing a class can frequently spill over into testing another class. A common example of this is classes that depend on a database: in order to test the class, the tester often writes code that interacts with the database. This is a mistake, because a unit test should never go outside of its own class boundary. As a result, the software developer abstracts an interface around the database connection, and then implements that interface with their own mock object. This results in loosely coupled code, minimizing dependencies in the system.&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Limitations of unit testing&lt;br /&gt;
&lt;/strong&gt;Unit testing will not catch every error in the program. By definition, it only tests the functionality of the units themselves. Therefore, it will not catch integration errors, performance problems or any other system-wide issues. In addition, it may not be easy to anticipate all special cases of input the program unit under study may receive in reality. Unit testing is only effective if it is used in conjunction with other software testing activities.&lt;br /&gt;
It is unrealistic to test all possible input combinations for any non-trivial piece of software. A unit test can only show the presence of errors; it cannot show the absence of errors. Though these two limitations apply to any form of software test.&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Techniques&lt;br /&gt;
&lt;/strong&gt;Unit testing is commonly automated, but may still be performed manually. As with many reputable standards bodies, the IEEE[1] prescribes neither an automated nor a manual approach. A manual approach to unit testing may employ a step-by-step instructional document. Nevertheless, the objective in unit testing is to isolate a unit and validate its correctness. Automation is efficient for achieving this, and enables the many benefits listed in this article. Conversely, if not planned carefully, a careless manual unit test case may execute as an integration test case that involves many software components, and thus preclude the achievement of most if not all of the goals established for unit testing.&lt;br /&gt;
Under the automated approach, to fully realize the effect of isolation, the unit or code body subjected to the unit test is executed within a framework outside of its natural environment, that is, outside of the product or calling context for which it was originally created. Testing in an isolated manner has the benefit of revealing unnecessary dependencies between the code being tested and other units or data spaces in the product. These dependencies can then be eliminated through refactoring, or if necessary, re-design.&lt;br /&gt;
Using a unit testing framework, the developer codifies criteria into the unit test to verify the correctness of the unit under test. During execution of the unit test(s), the framework logs test cases that fail any criterion. Many frameworks will also automatically flag and report in a summary these failed test cases. Depending upon the severity of a failure, the framework may halt subsequent testing.&lt;br /&gt;
As a consequence, unit testing is traditionally a motivator for programmers to create decoupled and cohesive code bodies. This practice promotes healthy habits in software development. Design patterns, unit testing, and refactoring often work together so that the most ideal solution may emerge.&lt;/p&gt;
&lt;/dd&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122601"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122601" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/elinden/aggbug/122601.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>elinden</dc:creator>
            <guid>http://geekswithblogs.net/elinden/archive/2008/06/03/why-unit-test-again.aspx</guid>
            <pubDate>Wed, 04 Jun 2008 03:16:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/elinden/comments/122601.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/elinden/archive/2008/06/03/why-unit-test-again.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/elinden/comments/commentRss/122601.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/elinden/services/trackbacks/122601.aspx</trackback:ping>
        </item>
    </channel>
</rss>