I have created a new project on CodePlex called it NCommon. This CodePlex project hosts the entire source code of all the various frameworks and patterns that I have talked about on this blog.

Previously the source was coupled with Rhinestone, the bug reporting app I am working on. While that seamed fine for a while, I started to realize that all the framework level stuff could be bundled up as a separate library that could then be used in multiple applications. Hence the creation of the NCommon project.

I intend to put all common framework level stuff into this project and try to keep it as infrastructure agnostic as possible. NCommon currently has source for:

I have gotten rid of the generic IoC wrapper implementation from the library as it doesn’t seem necessary anymore with the rally behind the Common Service Locator project. I will also be adding implementations of the Repository and Unit of Work patterns for Linq to SQL, Entity Framework and NHibernate(*) soon

I have some more ideas on what could go into NCommon, but that’s for future posts. If anone have any suggestions or ideas on what other common functionality they would like to add to NCommon or if you would like to contribute to NCommon I’d be more more than willing to listen.

* I’m not sure what the state of Linq to NHibernate is right now so the implementation of RepositoryBase for NHibernate may be delayed until the NHiberante can provide a stable implementation of their Linq provider.

Posted on Tuesday, December 02, 2008 11:38 AM | Filed Under [ Patterns ]


Comments

Gravatar
# Maybe I am missing the point here but this idea lo...
Posted by Nikola Malovic
on 1/25/2009 12:48 AM
Maybe I am missing the point here but this idea looks somehow similar to Ayende's rhino commons (abstract unit of work, repositories etc) <BR/>svn.sourceforge.net/.../>Am I misssing the point? :)
Gravatar
# Absolutely awesome stuff!<br><br>My only suggestio...
Posted by Justin
on 12/4/2008 3:08 AM
Absolutely awesome stuff!<BR/><BR/>My only suggestion for NCommon is to move some of the stuff into seperate namespaces, i.e. ITransaction, Storage stuff, pretty much anything that doesn't need to be seen/used for day to day coding.
Gravatar
# Anonymous:<br>============<br>Thanks for the sugge...
Posted by Ritesh Rao
on 12/3/2008 9:18 PM
Anonymous:<BR/>============<BR/>Thanks for the suggestion. I am considering adding, Attach, Detach and Refresh methods for dealing with detached entities.<BR/><BR/>But I don't think that those methods fall under the realm of Unit of Work. The primary responsiblity of the Unit of Work pattern is provide a consistent scope for defining a set of operations as a unit of work, and to provide a transactional boundary. Adding those methods to the IUnitOfWork would be violating the Single Responsibility principal.<BR/><BR/>I am considering adding them to the IRepository where it actually belongs. Implementations of the IRepository should be responsible for getting the current session/context from the current IUnitOfWork and then call the appropriate methods on the IUnitOfWork implementations. <BR/><BR/>Also, I'm keeping away from the Evict naming because first it's too NHibernate specific and personally believe the Evict does not properly depict the true meaning of the operation. Detach is more concise and clear on it's intention. (I actually believe that NHibernate should have never called it Evict in the first place).
Gravatar
# I'd like to suggest you add Evict['T(T entity) and...
Posted by Anonymous
on 12/3/2008 4:27 AM
I'd like to suggest you add Evict['T(T entity) and Refresh['T(T entity) methods to the IUnitOfWork interface. <BR/><BR/>These calls are invaluable in certain situations where a lower level process, primarily support for pessimistic locking, is in play, and the entity under control of the unit of work's underlying session/context must be evicted or refreshed before other operations overridden in a repository superclass can proceed.<BR/><BR/>In any case, an implementer can either support the calls or return a not supported exception.
Post Comment
Title *
Name *
Email
Url
Comment *  
Please add 7 and 6 and type the answer here: