Browse DevX
Sign up for e-mail newsletters from DevX


A Pure Object-oriented Domain Model by a DB Guy, Part 2 : Page 3

This is the second in a new series of articles by Jimmy Nilsson on a new architecture for enterprise applications in .NET. The new architecture is purely object- oriented, while still focusing on roundtrips and the data access code to get good performance. This articles delves into the most important base class for the new architecture.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

One base class dropped, one left
So, there’s only one base class left to discuss, namely the EntityBase. Let’s take a closer look at the surviving base class.

There is a lot of general code in the base class, so when you write the specific subclasses you don’t have to write much code, just describe the specifics. Even though I can’t discuss all of it now, I’d like to briefly mention all the public methods and properties of the base class. In this way I hope to give you an idea of the functionality with which the base class helps the custom domain classes and also give you an idea of what I’ll be discussing in future articles. (As you might imagine there’s a wealth of protected some of those are Overridable (virtual) and private members too, but I’ll save that for the time being.)


The EntityBase class is shown in Figure 3.

Figure 3 The EntityBase class


This (ReadOnly) property will return the primary key of the object (or rather, row) in the database. I’ll simplify for now and assume that all tables in the database have a single column for the primary key and are of the same data type, for example UNIQUE IDENTIFIER (GUID).

Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date