Poco Members
   HOME

TheInfoList



OR:

In
software engineering Software engineering is a branch of both computer science and engineering focused on designing, developing, testing, and maintaining Application software, software applications. It involves applying engineering design process, engineering principl ...
, a plain old CLR object, or plain old class object (POCO) is a simple object created in the .NET
Common Language Runtime The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instr ...
(CLR) that is unencumbered by inheritance or attributes. This is often used in opposition to the complex or specialized objects that object-relational mapping frameworks often require. In essence, a POCO does not have any dependency on an external framework.


Etymology

''Plain Old CLR Object'' is a play on the term ''
plain old Java object In software engineering, a plain old Java object (POJO) is an ordinary Java object, not bound by any special restriction. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000: The term "POJO" initially den ...
'' from the
Java EE Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web serv ...
programming world, which was coined by Martin Fowler in 2000. POCO is often expanded to ''plain old C# object'', though POCOs can be created with any language targeting the CLR. An alternative acronym sometimes used is ''plain old .NET object''.See, for example, a reference to PONO in this whitepaper
Spring.net Reference Documentation


Benefits

Some benefits of POCOs are: * allows a simple storage mechanism for data, and simplifies serialization and passing data through layers; * goes hand-in-hand with
dependency injection In software engineering, dependency injection is a programming technique in which an object or function receives other objects or functions that it requires, as opposed to creating them internally. Dependency injection aims to separate the con ...
and the repository pattern; * minimised complexity and dependencies on other layers (higher layers only care about the POCOs, POCOs don't care about anything) which facilitates loose coupling; * increases testability through simplification.


See also

*
Plain old data structure In computer science and object-oriented programming, a passive data structure (PDS), also termed a plain old data structure or plain old data (POD), is a record, in contrast with objects. It is a data structure that is represented only as passive ...
*
Plain old Java object In software engineering, a plain old Java object (POJO) is an ordinary Java object, not bound by any special restriction. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000: The term "POJO" initially den ...
*
Data transfer object In the field of programming a data transfer object (DTOMSDN (2010). Data Transfer Object. Microsoft MSDN Library. Retrieved from https://msdn.microsoft.com/en-us/library/ms978717.aspx.Fowler, Martin (2010). Data Transfer Object. Patterns of Enterpr ...


References

.NET terminology {{Compu-lang-stub