<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://devlicio.us/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Billy McCafferty : NHibernate, Architecture</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/Architecture/default.aspx</link><description>Tags: NHibernate, Architecture</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>IT Samurai School coming soon...</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/2009/05/03/it-samurai-school-coming-soon.aspx</link><pubDate>Mon, 04 May 2009 02:32:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:46471</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;As if my life wasn&amp;#39;t boring enough trying to get S#arp Architecture 1.0 out the door...&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.itsamuraischool.com/"&gt;&lt;img style="border:0;" alt="www.itsamuraischool.com" src="http://devlicio.us/resized-image.ashx/__size/600x450/__key/CommunityServer.Components.UserFiles/00.00.00.21.06/itsamuraischool.gif" width="550" height="347" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=46471" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/.NET/default.aspx">.NET</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Software+Development/default.aspx">Software Development</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Algorithms/default.aspx">Algorithms</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Refactoring/default.aspx">Refactoring</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Project+Management/default.aspx">Project Management</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Test-Driven+Development/default.aspx">Test-Driven Development</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Agile+Development/default.aspx">Agile Development</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/MVC.NET/default.aspx">MVC.NET</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/S_2300_arp+Architecture/default.aspx">S#arp Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/DDD/default.aspx">DDD</category></item><item><title>S#arp Architecture: a new home, upgrades and a logo!</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/2008/08/08/s-arp-architecture-a-new-home-upgrades-and-a-logo.aspx</link><pubDate>Fri, 08 Aug 2008 20:19:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:41767</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>5</slash:comments><description>&lt;p&gt;&lt;img width="206" vspace="6" hspace="6" height="91" align="right" alt="S#arp Architecture" style="width:206px;height:91px;" title="S#arp Architecture" src="http://devlicio.us/blogs/billy_mccafferty/sharp_arch.jpg" /&gt;To facilitate better integration with SVN clients, S#arp Architecture has been moved to Google Code at &lt;a href="http://code.google.com/p/sharp-architecture"&gt;http://code.google.com/p/sharp-architecture&lt;/a&gt;.&amp;nbsp; Additionally,&amp;nbsp;a discussion group has just been setup on Google Groups at &lt;a href="http://groups.google.com/group/sharp-architecture"&gt;http://groups.google.com/group/sharp-architecture&lt;/a&gt;&amp;nbsp;to support use of the architecture, discuss the ideas and patterns behind it, offer suggestions for improvement, and exchange ideas for using it in real-world applications.&lt;/p&gt;
&lt;p&gt;So why a bonsai tree on the logo?&amp;nbsp; Bonsai trees are small, have years of&amp;nbsp;practice&amp;nbsp;trained into their shape, and have a solid&amp;nbsp;core...all the attributes that I hope S#arp Architecture exhibits.&amp;nbsp; Besides, if they&amp;#39;re cool enough for Mr. Miyagi, then the choice is obvious!&lt;/p&gt;
&lt;p&gt;By the way, &lt;a href="http://code.google.com/p/sharp-architecture/downloads/list"&gt;S#arp Architecture 0.7.3&lt;/a&gt; currently supports ASP.NET MVC Preview 4 and NHibernate 2.0 CR 1.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;br /&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=41767" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/MVC.NET/default.aspx">MVC.NET</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/S_2300_arp+Architecture/default.aspx">S#arp Architecture</category></item><item><title>S#arp Architecture 0.7 now supports NHibernate 2.0 Beta 1</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/2008/07/10/s-arp-architecture-0-7-now-supports-nhibernate-2-0-beta-1.aspx</link><pubDate>Thu, 10 Jul 2008 06:36:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:41248</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;&lt;a href="http://www.codeplex.com/SharpArchitecture/Release/ProjectReleases.aspx?ReleaseId=15182"&gt;S#arp Architecture 0.7&lt;/a&gt; represents a major upgrade to the infrastructure of S#arp
Architecture - but the overall architecture, with respect to application
layering, remains the same.&amp;nbsp; This release is far simpler to work with than
previous versions while still providing plenty of flexibility.&amp;nbsp; A huge
thanks goes out to Frank Laub who has provided terrific feedback and
guidance on making S#arp Architecture simpler while using it on
real-world web applications.&amp;nbsp; This release&amp;#39;s many changes include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;NHibernate 2.0 Beta 1 integration is now included.&lt;/li&gt;
&lt;li&gt;Integration
with Spring.NET has been dropped. Spring.NET is a fantastic library
with world class AOP, IoC support, and many other modules. But for
S#arp Architecture, a simpler approach was found for performing
dependency injection without the need for external configuration files.
If you&amp;#39;re still in need of many of Spring.NET&amp;#39;s terrific libraries,
you&amp;#39;ll want to take a look at release 0.6.* which comes preconfigured
with Spring.NET.
&lt;ul&gt;
&lt;li&gt;The ~/SpringConfig folder no longer exists&lt;/li&gt;
&lt;li&gt;There is no more SpringInteropController&lt;/li&gt;
&lt;li&gt;The Spring XML generator has been dropped from ProjectBase&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;GenericDAO now uses the native NHibernate session.&lt;/li&gt;
&lt;li&gt;HTTP Modules are no longer needed to support the Open-Session-in-View pattern for NHibernate session management.&lt;/li&gt;
&lt;li&gt;All configuration, such as the DB connection string, is now just within web.config.&lt;/li&gt;
&lt;li&gt;Concrete types needed for Dependency injection are now declared at the top of each dependency interface; e.g., IOrderDao.&lt;/li&gt;
&lt;li&gt;NHibernate
session storage mechanisms, for both web and unit-tests/winforms have
been added to ProjectBase.Data and ProjectBase.Web.&lt;/li&gt;
&lt;li&gt;The Identity attribute has been renamed to DomainSignature to better reflect its purpose.&lt;/li&gt;
&lt;li&gt;Controllers now simply inherit from the base MVC Controller.&lt;/li&gt;
&lt;li&gt;ProjectBase.Web.ControllerFactory has been introduced with built in dependency injection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; I&amp;#39;m confident you&amp;#39;ll be very pleased with the changes and
would highly recommend upgrading your project if you&amp;#39;re already using
this framework and do not need the many powerful utilities found within
Spring.NET.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeplex.com/SharpArchitecture"&gt;http://www.codeplex.com/SharpArchitecture&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=41248" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/S_2300_arp+Architecture/default.aspx">S#arp Architecture</category></item><item><title>S#arp Architecture upgraded to ASP.NET MVC Preview 3</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/2008/06/09/s-arp-architecture-upgraded-to-asp-net-mvc-preview-3.aspx</link><pubDate>Tue, 10 Jun 2008 05:34:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:40932</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>7</slash:comments><description>&lt;p&gt;S#arp Architecture has been upgraded for compatibility with ASP.NET MVC Preview 3 and Spring.NET 1.1.2..&amp;nbsp; A big thanks goes out to Adam Cooper and Frank Laub for assisting with this effort.&amp;nbsp; S#arp Architecture, an architectural framework for developing applications with ASP.NET MVC, Spring.NET and NHibernate, may be found at &lt;a href="http://www.codeplex.com/SharpArchitecture"&gt;http://www.codeplex.com/SharpArchitecture&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=40932" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/MVC.NET/default.aspx">MVC.NET</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Spring.NET/default.aspx">Spring.NET</category></item><item><title>S#arp Architecture:  ASP.NET MVC with NHibernate</title><link>http://devlicio.us/blogs/billy_mccafferty/archive/2008/04/21/asp-net-mvc-best-practices-with-nhibernate-and-spring-net.aspx</link><pubDate>Mon, 21 Apr 2008 22:44:00 GMT</pubDate><guid isPermaLink="false">40756a8b-6212-4073-9d98-6c26781577de:40135</guid><dc:creator>Billy McCafferty</dc:creator><slash:comments>54</slash:comments><description>&lt;p&gt;To skip to the chase...&amp;nbsp; &lt;a href="http://code.google.com/p/sharp-architecture/"&gt;http://code.google.com/p/sharp-architecture/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It wasn&amp;#39;t too many years ago that I used to state quietly that I was a Microsoft web developer.&amp;nbsp; Inevitably, a Java developer would hear my whisper and begin laughing hysterically as I cowered away from defending Active Server Pages.&amp;nbsp; Not long after, I felt a bit more confident defending Microsoft web development after the introduction of ASP.NET but have yet to this day been able to accurately describe the page life cycle&amp;nbsp;or defend&amp;nbsp;why the *%$@ it was ever a good idea.&amp;nbsp;&amp;nbsp;While the .NET language continued to progress into a&amp;nbsp;world class&amp;nbsp;language with generics and&amp;nbsp;LINQ, I often wondered when the presentation layer would get the attention it deserved.&amp;nbsp; To add insult to injury, the Rails crew was quick to join in the&amp;nbsp;hysterics that the Java community had long been enjoying.&amp;nbsp; To make up for the deficiencies of developing Microsoft web applications, many of us would come up with near ridiculous schemes to facilitate even a partial amount of test driven development and properly tiered layers.&amp;nbsp; With ASP.NET MVC, we now easily stand shoulder to shoulder with the clean separation of concerns enjoyed by other technologies.&amp;nbsp; But with any new technology, there is&amp;nbsp;a dire and immediate need for communications and guidance concerning how to develop a solid, testable web application using time tested patterns for rapid development and long term maintainability.&amp;nbsp; With this post, I hope to do just for ASP.NET MVC.&lt;/p&gt;
&lt;p&gt;Pronounced &amp;quot;Sharp Architecture,&amp;quot; this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate 1.2 and Spring.NET 1.1.1.&amp;nbsp; The primary advantage to be sought in using any architectural framework is to decrease the code one has to write while increasing the quality of the end product.&amp;nbsp; A framework should enable developers to spend little time on infrastructure details while allowing them to focus their attentions on the domain and user experience.&amp;nbsp; Accordingly, S#arp Architecture adheres to the following key principles:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Focused on Domain Driven Design&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This architecture places emphasis on the domain as being the core element of focus.&amp;nbsp; Accordingly, the domain layer has no direct dependencies on any data loading mechanisms or other resource dependent services.&amp;nbsp; This facilitates a test driven approach to developing the domain without the need for external resources, such as a database, to be available during domain development.&amp;nbsp; (Alternatively, some developers prefer a model driven approach to application development.&amp;nbsp; A solid framework for supporting this alternative style is the ADO.NET Entity Framework.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Loosely Coupled&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;All layers within S#arp Architecture depend only on the core domain layer and framework utilities.&amp;nbsp; In many applications, the presentation tier depends on a service tier which depends on a domain tier which depends on a data access tier.&amp;nbsp; A frequent problem with this is that every layer &amp;quot;up the chain&amp;quot; inherently depends on every tier below it.&amp;nbsp; This tight coupling makes it increasingly more difficult, as development on a project proceeds, to make modifications to lower tiers without having an adverse affect on the tiers above it.&amp;nbsp; Alternatively, this architecture keeps the tiers loosely coupled from each other; e.g., the controller and domain logic layers have no direct dependency on the data tier.&amp;nbsp; To facilitate this, the core domin layer, in addition to defining the domain model and logic, also define service interfaces which are needed by other layers.&amp;nbsp; (Examples of a &amp;quot;service&amp;quot; include a data access object, a ftp utility, or a web service.)&amp;nbsp; In this way, the controller logic only has knowledge of data access interfaces, for which implementation details can be injected at runtime.&amp;nbsp; This loosely coupled design further faciliates test driven development and allows dependencies to be more easily modified, if not completely replaced, with no affect on &amp;quot;higher&amp;quot; tiers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Preconfigured Infrastructure&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Developers often spend much of their time maintaining data access and other infrastructure related layers.&amp;nbsp; Furthermore, infrastructure to facilitate test driven development which bypasses live data access code is often complicated and error prone to configure.&amp;nbsp; By leveraging NHibernate 1.2 for data access, along with the benefits of .NET generics, it is rarely the case, using this described approach, that even a single line of code need be written to have full data access capabilities for a given domain object.&amp;nbsp; Spring.NET 1.1 is then leveraged to provide dependency injection of concreate data access objects into the controllers layer.&amp;nbsp; (Alternatively, the data access objects could be injected into a service layer when appropriate.)&amp;nbsp; To reduce the risk of introducing bugs into XML configuration files, this framework includes a Spring.NET XML configuration generator to handle defining data access objects (DAOs), controllers, and DAO injection into controller constructors.&amp;nbsp; The only time it is necessary to configure Spring.NET XML is when custom DAOs are required.&amp;nbsp; Note that this is the only code generation in the entire framework.&amp;nbsp; There is no bazillion lines of data access code generated upon every compilation.&amp;nbsp; There are no magically created partial classes to facilitate data access.&amp;nbsp; This makes for a much more understandable and maintainable application.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Open Ended Presentation&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There are a plethora of great alternatives available for building the presentation layer of an application.&amp;nbsp; Consequently, S#arp Architecture mandates few, if any, constraints on how the presentation layer should be designed and developed.&amp;nbsp; In fact, the only constraint is that ASP.NET MVC be leveraged; other than that, any presentation option is available for use.&amp;nbsp; To illustrate, this framework shows no preferences towards any particular presentation solution such as jQuery, Yahoo UI widgets, or the Microsoft AJAX utilities.&amp;nbsp; As long as your preferred mechanism works with MVC, this framework will accommodate it.&lt;br /&gt;&lt;br /&gt;To better facilitate community involvement, to provide releases for later versions of ASP.NET MVC and other framework dependencies, and to manage documentation (with a comprehensive walk through lab), S#arp Architecture is being managed at &lt;a href="http://code.google.com/p/sharp-architecture/"&gt;http://code.google.com/p/sharp-architecture/&lt;/a&gt;.&amp;nbsp; The corresponding discussion group may be found at &lt;a href="http://groups.google.com/group/sharp-architecture"&gt;http://groups.google.com/group/sharp-architecture&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I sincerely hope that this architecture will serve as a key element in enabling you to create high quality applications which both you and your clients can take pride in.&amp;nbsp; This work reflects the knowledge of industry experts, the feedback garnered from past experiences, and the help of many people who have lent a hand or provided guidance and/or feedback when needed.&amp;nbsp; Particularly, I&amp;#39;d like to thank Damon Carr, Ben Scheirman, Alan Northam, Mark Pollack and Erich Eichinger of the Spring.NET team, Wayde Gilliam and the hundreds of developers who helped me hone my ideas by providing great feedback over the past couple of years.&amp;nbsp; A special thanks also goes to Roy Bradley who made it possible for me to spend as much time as I did on this effort.&lt;/p&gt;
&lt;p&gt;Some&amp;nbsp;&lt;span style="text-decoration:line-through;"&gt;useful&lt;/span&gt; essential background material for this architecture may be found at &lt;a href="http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx"&gt;http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx&lt;/a&gt;.&amp;nbsp; Although there are major changes in the infrastructure of the new architecture, the overall structure is similar to that presented in this previous article.&amp;nbsp; So it&amp;#39;s a great starting point for getting up to speed with the knowledge areas included.&lt;/p&gt;
&lt;p&gt;The overall goal of this architecture is to allow developers to worry less about application &amp;quot;plumbing&amp;quot; and to spend most of their time on adding value for the client by focusing on the business logic and developing a rich user experience.&amp;nbsp; Enjoy and keep the feedback coming!&lt;/p&gt;
&lt;p&gt;Billy McCafferty&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://devlicio.us/aggbug.aspx?PostID=40135" width="1" height="1"&gt;</description><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Featured/default.aspx">Featured</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/MVC.NET/default.aspx">MVC.NET</category><category domain="http://devlicio.us/blogs/billy_mccafferty/archive/tags/Spring.NET/default.aspx">Spring.NET</category></item></channel></rss>