Plain old CLR object

In software engineering, a plain old CLR object (POCO) is a simple object created in the Common Language Runtime (CLR) of the .NET Framework which is unencumbered by inheritance or attributes. This is often used in opposition to the complex or specialised objects that object-relational mapping frameworks often require.[1] 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 from the Java EE programming world, which was coined by Martin Fowler in 2000.[2] 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.[3]

Benefits

Some benefits of POCOs are:

  • allows a simple storage mechanism for data, and simplifies serialisation and passing data through layers;
  • goes hand-in-hand with dependency injection 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.
gollark: Doesn't matter that much, my dynamic IP thing means that it alternates between my actual location and nearby villages.
gollark: Yes to 1, probably not to 2.
gollark: My actual computer has terrible throughput, because powerline adapters, but the YAH server is/was on direct Ethernet.
gollark: BT isn't entirely awful and YAH was low-traffic.
gollark: Basically, the reverse engineering thing exists to remove things TJ09 dislikes.

See also

References

  1. See, for example, this MSDN article: Data Contracts - POCO Support
  2. See anecdote here: http://www.martinfowler.com/bliki/POJO.html
  3. See, for example, a reference to PONO in this whitepaper: Spring.net Reference Documentation


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.