From msdn magazine article (a bit old but valid) : http://msdn.microsoft.com/en-us/magazine/ff898427.aspx
Finally SevDer ORM+ had a long way so far and almost ready.
I would like to share the first preliminary screens.
Tool will be completed by tonight/tomorrow I hope.
Here you just need to select the profile or just start building one.
Very simple profile setup..
Here you go with code generation, ORM kicks the way you need!
As you see even it generates ASCX files (I will in the future add ASPX option and MVC/RAZOR too, but not yet)
After getting frustrated with the fact that Entity Framework and NHibernate does not resolve my needs, I am writing my own ORM tool to finalize one very important part of enterprise architecture.
Here are the features that are included (hope to finish by tomorrow)
- Mutliple entity classes (one per each)
- Single Data Provider Class
- One Interface IDataProvider
- One Class which inherits I[Model]DataProvider (SQL[Model]DataProvider)
- [Model] to be renamed by the model name provided
- One mocked class using moq framework (http://code.google.com/p/moq/)
- SQL[Model]DataProvider will also implement retry logic in case of certain cases such as
- Connection Timeout etc.
- In a nutshell the following error codes : -1,-2,2,53,1222,1205
- Will obviously generate related stored procedures and utilize them
- Entities will be able to track simultaneous changes and will be able to throw exception if data changed before update!
- Entities will implement [DataContract] & [DataMember] so that usage in WCF will be a lot easy
- As you may see from here generated codes will implement Abstract Factory (Provider) design pattern and possibility of Singleton is also there.
After doing enough research on both, what we’ve end up doing is; not using any ORM tool.
ORMs are designed to do rapid development for RIA (Rich Internet Applications) where performance is not a big concern.
Yes, ORM can speed up your development such as EF 4.0 or NH but they all lack one very important thing which is support for Stored Procedures for general select which shall be by default. All ORMs are focused on eliminating that and trying to optimize queries without SP.
If you ask me, SP are most useful when you use for select in general because you can really optimize the execution plan and it will be cached on SQL server. So in all subsequent calls to the database with same routine, SQL server will always know the execution plan and it will save time. [SP's execution plans are cached on SQL server.]
Therefore not using ORM is my choice.
Here are what I lose by not using ORM
- Extra quick development
- Default behavior of throwing exception on an update where data was already changed before the update (concurrency handling)
- Will get the best performance
- My code will not have unnecessary extra code which I may not even use
- Will use SP’s the way they are supposed to be used
- Will abstract data layer in the most perfect manner
- Improve existing code generator to do my own ORM (no oData)
- All entities will be generated with DataContracts, DataMembers (necessary in WCF)
- Proper implementation of RETRY logic in SQL Exceptions (if you ever want to move into SQL Azure, you need to do this also)
- Will implement concurrency handling