Aptify Generic Entity versus Aptify Generic Entity Base
When reviewing the Aptify Software Development Kit (SDK), a developer may notice that the Aptify.Framework.BusinessLogic.GenericEntity namespace includes an AptifyGenericEntity class and an AptifyGenericEntityBase class. These two classes serve different purposes within the Aptify Framework:
- AptifyGenericEntityBase defines the interface and base implementation of the Generic Entity (GE) object.
- AptifyGenericEntity contains the complete implementation of AptifyGenericEntityBase.
When assigning variables and passing them throughout the system, especially as parameters in public or protected methods, use AptifyGenericEntityBase. When creating a new Entity object, the AptifyGenericEntity is used as the super class. In other words, Entity objects should inherit from AptifyGenericEntity, which is the complete implementation of the GE. When you sub-class, you want to start with the complete implementation and go from there.
The separation was necessary to eliminate direct circular references between assemblies in .NET. For example, the AptifyApplication object references the AptifyGenericEntityBase object in order to support methods like GetEntityObject which returns a reference to an AptifyGenericEntityBase object. AptifyGenericEntity references the AptifyApplication object in order to use some of its standard methods. That is allowed by .NET, but what is not allowed is for AptifyApplication to reference AptifyGenericEntity and AptifyGenericEntity to reference AptifyApplication. By splitting the GE into the GE and GEBase, a level of indirection is introduced and that indirection allows for the desired functionality inside the Framework.
Copyright © 2014-2019 Aptify - Confidential and Proprietary