tags:

views:

3174

answers:

8
+18  Q: 

Define 'poco'?

Can someone define what exactly 'poco' means? I've encountering the term more and more often and I'm wondering is it only about plain classes or it mean something more?

+14  A: 

"Plain Old C# Object"

Just a normal class, no attributes describing infrastructure concerns or other responsibilities that your domain objects shouldn't have.

EDIT - as other answers have stated, it is technically "Plain Old CLR Object" but I, like David Arno comments, prefer "Plain Old Class Object" to avoid ties to specific languages or technologies.

David Mohundro
I would view a POCO as a plain old class that doesn't try to be part of the trendy pattern set. However I like your answer too.
David Arno
Agreed - not a fan of the C# name, but that was what I first heard when I was wondering about the question :) Class then fits POJO, POVBO POC#O, POC++O, PORO, etc.
David Mohundro
A: 

In Java land typically "PO" means "plain old". The rest can be tricky, so I'm guessing that your example (in the context of Java) is "plain old class object".

some other examples

  • POJO (plain old java object)
  • POJI (plain old java interface)
basszero
+12  A: 

POCO stands for "Plain Old CLR Object".

Robert Gamble
+3  A: 

To add the the other answers, the POxx terms all appear to stem from POTS (Plain old telephone services).

The POX, used to define simple (plain old) XML, rather than the complex multi-layered stuff associated with REST, SOAP etc, was a useful, and vaguely amusing, term. PO(insert language of choice)O terms have rather worn the joke thin.

David Arno
+5  A: 

Most people have said it - Plain Old CLR Object (as opposed to the earlier POJO - Plain Old Java Object)

The POJO one came out of EJB, which required you to inherit from a specific parent class for things like value objects (what you get back from a query in an ORM or similar), so if you ever wanted to move from EJB (eg to Spring), you were stuffed.

POJO's are just classes which dont force inheritance or any attribute markup to make them "work" in whatever framework you are using.

POCO's are the same, except in .NET.

Generally it'll be used around ORM's - older (and some current ones) require you to inherit from a specific base class, which ties you to that product. Newer ones dont (nhibernate being the variant I know) - you just make a class, register it with the ORM, and you are off. Much easier.

Nic Wise
just for the sake of completeness, CLR stabds for Common Language Runtime - the .net virtual machine.
philippe
+1 for mentioning its (usual) relation to ORMs
Lucas
.Net 3.5 sp1 ORM example: the Entity framework requires that classes inherit from a certain framework class. LINQ to SQL does not have this requirement. Therefore LINQ to SQL works with POCOs and the Entity framework does not.
Lucas
A: 

Interesting. The only thing I knew that had to do with programming and had POCO in it is the POCO C++ framework.

ayaz
+1  A: 

It's also funny that "poco" is a Spanish word meaning "little, not much". So, it fits this context nicely! http://en.wiktionary.org/wiki/poco

EnocNRoll