Feeds:
Posts
Comments

Archive for the ‘ORM’ Category

I am working on a large database project (see article on news aggregator for trading)  and don’t want to a) use stored procedures and b) don’t want to have to code loads of NHibernate mapping files and logic. I looked at various different technologies for code generation and chose CodeSmith mainly because I still have [...]

Read Full Post »

I recently wrote a post about how to set up CW’s IOC container for applications. This post covered the most basic implementation to get an IOC container up and running. It is now time to cover a proper architecture for using IOC specifically for web applications / sites. The main problem with the previous implementation [...]

Read Full Post »

Why are the errors to do with mapping  from NHibernate so damn cryptic! As NHibernate uses Log4Net I added the following XML to an app.config file to my test project, included the log4net.dll reference and added this line of code to the TestFixture method to initialize Log4Net. log4net.Config.XmlConfigurator.Configure(); The config xml is: <?xml version=”1.0″ encoding=”utf-8″ ?> <configuration> [...]

Read Full Post »

My understanding of the NHibernate Session is that in the case of a web application, the ISession should be created and destroyed with each HttpRequest. This is probably the most efficient use of the session and enables easy use of lazy loading within a single request. Sessions do not require much overhead to create and [...]

Read Full Post »

This has probably been covered in a thousand blogs and technical articles but I couldn’t find one that covered this exact scenario, so here goes.. When adding a row to the link table between two entities in a many to many relationship, I wanted to make sure a single row is saved in the database but both [...]

Read Full Post »

I am working on a legacy system where some of the database tables are called the same names as SQL reserved words. One example is the the table User. If you define your class as the name of the table, i.e. User, then the mapping will succeed but any queries will fail. If you are [...]

Read Full Post »

After a lot of thought I have decided not to use Castle’s Active Record. (http://www.castleproject.org/ActiveRecord/) The main reason for this is that I don’t see much benefit to adding properties to my classes other than not having to change things in both the class and XML, and the hassle of finding a code generator for [...]

Read Full Post »

As I am going to be using an Active Record as the pattern of choice to access my repository, I decided to use Castle’s Active Record as this comes highly recommended to me from colleagues and I use the Windsor framework for IoC so I know they are good. The first thing I wanted was a [...]

Read Full Post »

Following on from my previous post about having an abstraction or adaptor layer between the ORM classes and Domain classes, I decided to put together a diagram and explanation of the architecture I am planning to use for complex web applications. The idea behind this is based upon the onion architecture (see http://jeffreypalermo.com/blog/the-onion-architecture-part-1/) and various [...]

Read Full Post »

I had a think about why NHibernate and MS Linq To Entities mapped its classes the way it does and how the classes map exactly to the database schema and it struck me that the active record pattern is nothing more than a convenience rather than a revolution. I have been hand building classes that match [...]

Read Full Post »

Older Posts »

Follow

Get every new post delivered to your Inbox.