<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/RSabourin/category/8177.aspx</link>
        <description>Architecture</description>
        <language>en-US</language>
        <copyright>Remi Sabourin</copyright>
        <managingEditor>remi.sabourin@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Dependency Management - Update</title>
            <link>http://geekswithblogs.net/RSabourin/archive/2009/09/04/dependency-management---update.aspx</link>
            <description>&lt;p&gt;I posted last year regarding a dependency management tool I was contemplating.  Well, I can happily announce that I did create and launch the tool as I had envisioned it.   (I just actually completed a lunch and learn today where I unveiled it to a few more people within the company)&lt;/p&gt;
&lt;p&gt;In essence, it works by spidering the BUILD environment nightly and records all dependencies from code to code, from code to database and from database to database.  We have over 100 .Net solutions with multiple projects  within and all the references down to the method and database object level are recorded.  It was very satisfying recently  to clean up 1/3 of the code from a project as it was found to be no longer referenced (around 100 out of 300 stored procedures were removed).  This alone shaved about 1 month of developer effort out of a major refactoring initiative.&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;font size="2"&gt;I can't post or easily demo the tool as I developed it to work within our company intranet, but I thought I should point out some of the libraries I settled on to make &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;font size="2"&gt;this tool possible (these differ from the ones I was considering when I first posted about this last year).  If you haven't played with these but are the type that like to create innovative developer tools or efficiencies, these are a must for your arsenal:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;font size="2"&gt;Spidering DLLs: Mono.Cecil &lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 111%"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;font size="2"&gt;Spidering Code: NRefactory &lt;/font&gt;&lt;/span&gt;  &lt;/li&gt;
    &lt;li&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 20pt"&gt;&lt;font size="2"&gt;Spidering &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 24pt"&gt;&lt;font size="2"&gt;Databases: SMO &lt;/font&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 111%"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134490"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134490" 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/RSabourin/aggbug/134490.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Remi Sabourin</dc:creator>
            <guid>http://geekswithblogs.net/RSabourin/archive/2009/09/04/dependency-management---update.aspx</guid>
            <pubDate>Fri, 04 Sep 2009 06:03:14 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/RSabourin/comments/134490.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/RSabourin/archive/2009/09/04/dependency-management---update.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/RSabourin/comments/commentRss/134490.aspx</wfw:commentRss>
        </item>
        <item>
            <title>The Definition of a “Bad Design”</title>
            <link>http://geekswithblogs.net/RSabourin/archive/2009/08/13/the-definition-of-a-bad-design.aspx</link>
            <description>&lt;p&gt;I have been recently dealing with a somewhat tangled set of components where over time, developers have added references as needed to get things done quickly, creating circular and upstream references, resulting in low level layers depending on high level layers.  While looking for a nice little refresher online on dependency injection (incidentally, this is a great refactoring technique to fix this situation fast), I found this nice concise definition on bad design provided in an article by Robert C. Martin, Thoughtworks&lt;/p&gt;
&lt;p&gt;This seems like a great step to facilitate design reviews in a repeatable manner while avoiding digression into personal preference or opinion.  I look forward to reviewing designs on the basis of Rigidity, Fragility and Immobility. For the full article, visit &lt;font face=""&gt;http://www.objectmentor.com/resources/articles/dip.pdf&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;-------------------------------------------  ARTICLE EXCERPT -------------------------------------------&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;Have you ever presented a software design, that you were especially proud of, for review by a peer? Did that peer say, in a whining derisive sneer, something like: “Why’d you do it that way?”. Certainly this has happened to me, and I have seen it happen to many other engineers too. Clearly the disagreeing engineers are not using the same criteria for defining what “bad design” is. The most common criterion that I have seen used is the TNTWIWHDI or “That’s not the way I would have done it” criterion.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;But there is one set of criteria that I think all engineers will agree with. A piece of software that fulfills its requirements and yet exhibits any or all of the following three traits has a bad design. &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;It is hard to change because every change affects too many other parts of the sys-&lt;br /&gt;
    tem. (Rigidity)&lt;/li&gt;
    &lt;li&gt;When you make a change, unexpected parts of the system break. (Fragility)&lt;/li&gt;
    &lt;li&gt;It is hard to reuse in another application because it cannot be disentangled from &lt;br /&gt;
    the current application. (Immobility)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Moreover, it would be difficult to demonstrate that a piece of software that exhibits none of those traits, i.e. it is flexible, robust, and reusable, and that also fulfills all its requirements, has a bad design. Thus, we can use these three traits as a way to unambiguously decide if a design is “good” or “bad”&lt;/p&gt;
&lt;p&gt; -------------------------------------------  ARTICLE EXCERPT -------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134085"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134085" 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/RSabourin/aggbug/134085.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Remi Sabourin</dc:creator>
            <guid>http://geekswithblogs.net/RSabourin/archive/2009/08/13/the-definition-of-a-bad-design.aspx</guid>
            <pubDate>Fri, 14 Aug 2009 03:24:06 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/RSabourin/comments/134085.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/RSabourin/archive/2009/08/13/the-definition-of-a-bad-design.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/RSabourin/comments/commentRss/134085.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Dependency Management</title>
            <link>http://geekswithblogs.net/RSabourin/archive/2008/07/24/dependency-management.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;strong&gt;The Challenge&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;Imagine a development shop that maintains 100 .Net solutions, each composed of multiple projects. Imagine roughly half of these being shared domain services or shared common libraries, the other half being end web applications servicing multiple large clients.  Imagine any given project having the ability to reference classes/methods on any suitable re-usable service.   Imagine trying to get a grip on it all - a great architectural paradise or a great architectural nightmare.  Welcome to my world!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;For a while I have been thinking about a way to manage dependencies.  Dependencies hold us back, they make us scared to change things.  But when we don't evolve, we don't improve, we spend time doing complete rewrites or adding layer over layer of code bloat and we don't refactor to achieve enough of my favorite thing..... (c'mon guys, you know it's coming).... RE-USE.  &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;I am dreaming of a searchable database of dependencies, most it being automatically generated and updated, although some could be specified manually if indirect.  Basically a master tool that would spider our build and production server(s) and document dependencies to any artifact - code, databases, folders, etc.   If we want to remove/update/rename anything, we can be confident in our actions.  It would point out orphans that we can clean up so as to keep our systems/code clean.  It would plug into an automated build process and send dependency reports and alerts.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;strong&gt;The Research&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;Voice inside my head says "Start with the code".  I want to know for every method/property what method/property calls it in any project. Here's what has transpired so far:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;First I figure a little app that calls the .Net framework could be in order, that spits the results to a database.  I know System.Reflection has metadata on dlls built in. On further inspection, System.Reflection only exposes things in the manifest, which does include assembly references (a start), but does not provide an insight into method references.  Next I look at the CodeDom namespace - if similar to XML DOM, I could create a solution to parse the source code and I could iterate the dom to find function calls.  In fact, there is a CreateParser() method - too bad for me there's no implementation. Maybe in a future .Net version?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I took a look at NRefactory that is an API that comes with the SharpDevelop IDE but can't find much documentation on this to see if it could do the job.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Examined some out-of-the-box add-ins/tools, NDepends being a possibility.  I figured I would have an automated build output an XML file from NDepends and then I could have code that parses it for the dependencies and puts them in a database..  NDepends looks like a good tool with some interesting features and a query language, but it does not output method dependencies (only type and assembly ones), although you can see them if you drill down using the application.  There is also licensing per individual. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I thought dlls could maybe be reversed engineered; there is a tool that comes with .Net called ildasm.exe.  Its output though is intermediate language code which I'm not familiar with and would be kindof brutal to parse.  I found out Reflector has a "hidden" API if you reference the EXE.  &lt;font face="Arial"&gt; A nice MSDN article that has a promising name by James McCaffrey: &lt;font face="Arial"&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163641.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163641.aspx&lt;/a&gt;. May try this out, does not seem like the perfect high-level API but may not be too complicated knowing what exact statements to look for in intermediate language.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Then found out that FxCop also has a "hidden" API if you reference the EXE. Here's a nice doc Jason Kresowaty created to document this API: &lt;font face="Arial"&gt;&lt;a href="http://www.binarycoder.net/fxcop/pdf/fxcop.pdf"&gt;http://www.binarycoder.net/fxcop/pdf/fxcop.pdf&lt;/a&gt;.  This looks like the abstract API I was looking for.  This is my best bet right now&lt;/font&gt;&lt;font face="Arial"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;font size="2"&gt;The Execution&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Concluding my research, my goal in the next few weeks is to:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;- Use System.Reflection to log all the assembly references found in dlls&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;- Use FxCop or Reflector API to log all the method references found in dlls&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;- Log all the source code in the database (if this is impractical, use indexing service) so I can query it.  What the hey, why not use SQL Server's scptxfr.exe utility and log all the stored procs/views/triggers too.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;- Have a GUI for the development teams that displays dependencies between assemblies and allows you to drill down to methods.  Have GUI that allows you to search for ad hoc strings in the source code..&lt;font color="#ff0000"&gt;&lt;/font&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;I'll let you know how it turns out.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;P.S. If you know of some wicked tool that can do this for me and allow me to RE-USE and conserve time, let me know! &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123989"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123989" 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/RSabourin/aggbug/123989.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Remi Sabourin</dc:creator>
            <guid>http://geekswithblogs.net/RSabourin/archive/2008/07/24/dependency-management.aspx</guid>
            <pubDate>Thu, 24 Jul 2008 07:09:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/RSabourin/comments/123989.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/RSabourin/archive/2008/07/24/dependency-management.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/RSabourin/comments/commentRss/123989.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>