In terms of memory management, memory size, and simplicity, developers use best practices to create helper methods for a custom entity object.
So, I have my object, and I need to get, save, get the history, and maybe the find method. Three options:
Include methods in the object itself (get will be unintuitive that you will need to create a new object:
myObject.Get (ID)
Include methods as static methods of an object type.
MyObject myobject = MyObject.Get (id)
Create a new class of static methods, this will require that the developer can include two DLLs for the project. Entity, EntityHelper in each link
MyObject myobject = ObjectHelper.Get (id)
It seems that Microsoft chose option 1, I use List as an example, the object has an add, find and contains method.
If you decide to answer, first of all, thanks, and secondly, you can describe how memory is processed and garbage collection in each case.
Mike source
share