Include Page | ||||
---|---|---|---|---|
|
scrollbar |
---|
Introduction (NHibernate)
Current version of DelftShell - Q1, 2008 uses XML file format as a project store. It works ok for a simple applications where number of objects contained in the project is not so big or where size of those objects is not so big. When size of the objects becomes bigger - use of XML files as a data store format does not sound as a scalable and robust solution. Those objects can be for example: models, maps, grids, time series, model results, etc. Current intention is to switch to an embedded database file format to be used as a project store. It can be one of SQLite, Access or any other embedded database file format.
Another reason is that using XML serialization it seems to be very complicated to serialize objects implementing interfaces such as IModel, IDataItem. For that reason they were implemented as abstract classes.
In .NET access to the databased database is implemented using ADO.NET, however in this case syntax of the SQL queries used to access data dependents a lot from the concrete database driver implementation which. Another problem is that all data should be handled manually (convert from relational model to objects and vice-versa). There are number of libraries available which can help to access data from a database:
- NHibernate and probably NHibernate.Linq in the future - provides an easy to use framework for mapping an object-oriented domain model to a traditional relational database. See also NHibernate Best Practices
Advantages from use of the ORM libraries over simple ADO.NET implementation are clear and should not be underestimated:
...
More information about NHibernate can be found here:
- Getting Started with NHibernate
- NHibernate Reference Manual.
- Blame NHibernate - very good tips
- NHibernate Best Practices for ASP.NET, v1.2
- NHibernate by Justin Gehtland (TheServerSide.NET)
- NHibernate Reference Manual.
In a short functionality provided by NHibernate can be shown on the following drawing:
...
Note: drawing is taken from a Java version of Hibernate and contains method names in Java notation.
Anchor | ||||
---|---|---|---|---|
|
Project States in DelftShell