What is the difference between domain objects, POCOs and entities?

前端 未结 5 1902
萌比男神i
萌比男神i 2021-01-29 17:42

I was under the impression they are all basically the same. Are model objects also the same?

Right now, in my architecture, I have:

class Person 
{

            


        
5条回答
  •  故里飘歌
    2021-01-29 18:29

    It's more of a connotation of function; a domain object is something that is specific to your logic implementation and might be more complex than a simple POCO; an entity has a connotation to represent something (usually in reference to a persistence medium), and a POCO is just a quick identifier for a class. A model is just a term used to represent an object (usually containing state and usually dealing with the UI or DB).

    It's not that there is any functional difference, they're just different terms to more closely describe something. Like the difference between race car, truck, and family sedan. All are automobiles, but each term is more descriptive.

提交回复
热议问题