Reduced generated lines of code by 30%
Support for partial classes
Support for generics
Support for nullable types
Neo comes in two parts: The actual framework, i.e. the classes with which the application developer works, and the Visual Studio.NET 2005 plug-in which is needed at build time. The plug-in requires the NeoClass.2005.vtl and NeoSupport.2005.vtl templates in order to generate classes which contain all necessary information; the application developer described in the domain model XML file. Earlier investments in Neo are protected, there are no changes been made to the domain model schema. Savings of 30% are achieved on the generated lines of code through the use of generics.
In Neo the Entity Object world and ADO.NET world are brought together by Composition.
This requires concrete entity classes to wrap the corresponding DataRow, and store the necessary plumbing code in its base class.
public class Author : AuthorBase
protected internal Author(DataRow aRow, ObjectContext aContext)
: base(aRow, aContext)
With partial classes, code can be added to the class without having to recreate the source file.
Visual Studio 2005 uses this approach when creating Windows Forms, Web Service wrapper code, and so on. Neo does generate the concrete entity partial class and an additional user partial class in a separate file.
public partial class Author
The user Author partial class is intended for the application developer for making changes. The final Author entity is the combination of both parts at compile time.
To-many relations are managed and exposed by typed collections (Publisher-to-TitleRelation-to-Title).
The generic ObjectList<T> and ObjectRelation<T> collection classes replace the ObjectCollectionBase and ObjectRelationBase framework classes to provide type safety without having to generate additional relation classes.
Handling null values for value types required the application developer to override HandleNullValueForProperty, and provide default values. This requirement is rendered obsolete by the use of nullable types. A nullable type can represent the normal range of values for its underlying value type, plus an additional null value.
public virtual System.Decimal? Price
HandleNullValueForProperty is not supported in Neo2005 Preview.
In Neo 1.x the following code would throw an InvalidDbNullException exception. Since Royalty is a nullable type the code behaves accordingly.
title.Row["royalty"] = DBNull.Value;
For those who can’t wait to give the Neo2005 a try, drop me a line.