Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can I use POCO for?

I have read some articles on POCO in the enttity framework but still don't understand what I can use it for. How can POCO benefit my projects?

like image 897
Luke101 Avatar asked Oct 29 '09 23:10

Luke101


People also ask

What are the features of Poco launcher?

The launcher is loaded with some cool and unique features such as app categorization by colors and tabs, in-app search and more. Excited to know about them? Let’s check out the POCO Launcher features that will improve the overall experience of using it.

How to use reading mode on Poco phones?

Reading mode isn’t exclusive to Poco phones, but its useful to have. It kills blue light, helping to relax your eyes at night time. If you want to schedule it to come on at a specific time because you read before bed every night, you can. Just head to settings > Display > Reading mode. Now toggle on the schedule option.

What do I need to set up my Poco X3 NFC?

Here are the first 10 things you need to do when setting up your new Poco X3 NFC. The Poco X3 NFC comes with a side-mounted fingerprint sensor, departing from the embedded traditional sensor. The move will mirror the change for many to get used to it.

How to edit settings in Poco launcher?

Tap on POCO settings under POCO Launcher widget. Open the app drawer in POCO Launcher by swiping up on the home screen. Then tap on the three-bar icon at the top-right corner. You will be taken to settings. On the home screen, use the pinch-in gesture to go into the editing mode.


1 Answers

POCO standards for "Plain Old Clr Object". It refers to a style of ORM architecture where all the work for persisting and loading the data from the data store is done by the system with out the object itself knowing what is happening to it. This means that the ORM can support totally plain objects that haven't been modified in any way with the ORM in mind. An ORM that supports persistence of POCOs won't require you to have your class inherit from any specific base, implement any interface, or even tag methods with any attributes.

The complete opposite of this (sometimes known as Data Access Objects - or DAO) is when all of the storage is handled by the object itself, it knows exactly how to serialize and store itself and how to load itself when required. In this case the objects should be used purely to transfer the data and should not represent any of the business logic of the system.

In reality this is more of a spectrum with these two situations at either end. Many ORMs sit somewhere in the middle, requiring persistence to be handled externally to the class, but often also requiring some metadata or interfaces being implemented on the classes being persisted to help things along.

The EF (v1) does not support POCOs. The objects must implement various interfaces (to provide notification of property values changes etc) in order to be persistable by the framework. I believe there are addon frameworks that attempt to add POCO support to the EF, but I don't know how successful they are. The EF in .net 4.0 will have POCO support.

POCO is often considered good because it allows for a strong separation of concerns. You can define your data objects to have absolutely zero knowledge of the mechanism that will be used to store them. (So it makes it easy to switch out the storage mechanism for something different in the future). It also means you don't have to design your data objects with any consideration for the database/framework that is used to store them.

like image 175
Simon P Stevens Avatar answered Oct 10 '22 21:10

Simon P Stevens