poco

C# - Should an object be responsible for creating a history object when it changes something like status?

This is more of an architecture/best practices question than anything else, so please feel free to add your two cents. I know i stated status in the title, but this goes for any basic property of an object. I think the account example below will help demonstrate my question a little better than status. Here is a sample Account object: ...

EF4 how to delete entity in many-to-many relationship using POCOs

Hi, I'm using POCOs in combination with EF4 and some entities are in many-to-many relationships, in my case objects of class User and objects of class PrivilegeGroup. This is how class User looks like: public class User { public int UserID { set; get; } public string UserName { get; set; } public string UserPassword { get...

Can I use EF with POCO adapter without database operations?

I understand that EF is tightly mapped against database. I also understand that we can generate POCO classes replacing EF based classes. I have the following scenario. We have a large framework of legacy non-serializable API written in .NET framework 2.0 (and we cannot modify that). We will not have direct access to database and all ...

Error w/ C++ poco and HTTPSStreamFactory

I am trying to build a C++ app to access a XML resource. Using http the code works fine, from what I can tell from the docs, all I need to do to for the https to work is to make sure ssl is install (yes the dev edition is installed), and change the StreamFactory to HTTPSStreamFactory. Here is the code that works : Poco::Net::HTTPStream...

Entity Framework in Layered Architectures

Hello, Recently I've read article "The Entity Framework In Layered Architecture" and there is written we can send EF-entities to client through WCF. But in many threads on Stackoverflow people tell that POCO(DTO)-objects should be used when we use WCF. And I have some questions. Why did Microsoft add DataContract attribute to EF-enti...

ASP-MVC2, EF4 and POCO generator error

I'm developing application with ASP.MVC2 & EF4 and some time ago i've interested in POCO and tried to applay it to my project. I've found template to generate code on VisualStudioGallery, but it's not working. Installation was successful, but after choosing template to generate code, i've got error "Object reference not set to an insta...

How are the Poco C++ events handled?

Lets say i have a Poco::Thread: Thread Parent has an eventhandler method within it. The parent then spawns two children threads, who are given events that are the parent subscribes the eventhandler to. So two events both have the same event handler attached. If Child A triggers their event, and Parent starts to execute it, what would hap...

Object, entities, pocos, models etc

I have seen these terms used interchangebly on the web for objects (.Net). Could someone explain the difference between them. POCO Entity Model Domain Object Active Record Are Entities and POCO the same/similar? I normally think as Model objects as being part of the UI layer of an N-Tier architecture, is this correct? Are there ...

Entity Framework POCO Entities in n-tier web application

I'm new to EF4 and haven't had any experience with it before. So, bare with me if this is very simple question. I have my POCO entities (.tt file) in BOL, the .edmx file (EDM) in DAL and my webapp in Presentation layer. All the business logic goes to BLL layer. Here are the references: UI->BLL-DAL-BOL BLL->DAL-BOL DAL->BOL BOL->None of ...

C++ cross platform for processes: is POCO lib good? other alternatives?

Hi All I would like to use some cross platform C++ library for starting, stopping and getting standard output for processes. I found and I would like to use C++ POCO libraries: are these good? What's the best alternatives? I use Boost and they have Boost Process, but is not part of the official release and AFAIK it won't be neither ve...

EF4 Poco Issue Mapping Types Same Name Same Assembly Different Namespaces

I am experiencing an issue with EF4 and Proxy Pocos. I have 2 classes with the same name in the same assembly but different namespaces: QuoteModels.CashPayment OrderModels.CashPayment This compiles fine but at runtime EF throws the following exception: Schema specified is not valid. Errors: \r\nThe mapping of CLR type to EDM ...

How to serialize/deserialize simple classes to XML and back

Sometimes I want to emulate stored data of my classes without setting up a round trip to the database. For example, let's say I have the following classes: public class ShoppingCart { public List<CartItem> Items {get; set;} public int UserID { get; set; } } public class CartItem { public int SkuID { get; set; } public ...

OpenFrameworks/POCO Events not being listened?

Hello all, I'm having some problems with OpenFrameworks Event system, which is based on POCO's. I'm registering an event with ofNotifyEvent(ofEvent event) and definining the event listener with ofAddListener(ofEvent event,ListenerClass instance, ListenerMethod method) The class I'm registering as listener is never called when ofNotify...

Unable to use a Stored Procedure with my Entity Framework v4 + POCO's :(

Hi folks, I've got a very simple Entity Framework project with POCO Entities. I've got a single stored procedure which I have imported using the EF Wizard. Kewl. I've then made my own EF Entity which I've then Add Function Import to map the Stored Procedure to my EF Entity. Now ... I'm not sure how to map my EF Entity to a POCO. As su...

Serializing POCO Entities

Can I serialize POCO classes? I'm using the C# POCO entity generator. I tried to edit the .tt file which generates the entity classes to add the Serializable attribute. Is it right? ...

A better explanation of POCO

I'm wondering if anyone can give a solid explanation (with example) of POCO (Plain Old CLR Object). I found a brief explanation on Wikipedia but it really doesn't give a solid explanation. I'm looking for Pros/Cons... Implementation... Benefit... etc. Thanks in advance. ...

If Entity Framework is meant to work with POCOs, then why the dependency on IObjectSet?

I keep hearing about EF 4.0, POCO, IObjectSet, UnitOfWork (by the way, UoW is atleast more than 17 years old when I first heard it) etc. So some folks talk about Repository "pattern". etc. There are numerous bloggers showcasing their concoction of a "wrapper" or repository or something similar. But they all require IObjectSets (or in so...

Why would I want to use POCO's?

I currently use the Entity Framework designer to generate my persistance objects and I also user POCO view models for the ASp.NET MVC view. I've read and listened to a lot of people talking about the good support for POCO's in EF4 as well as POCO's in general but I can't seem to work out what advantage, if any I'll get from using them. ...

Update EF 4 Feature CTP 4 Detached POCO

I am trying to update a detached POCO w/ EF 4 CTP 4. My domain class looks like this: public class User { public int Id { get; set; } [Required, DisplayName("First Name")] public string FirstName { get; set; } [Required, DisplayName("Last Name")] public string LastName { get; set; } [ConcurrencyCheckAttribute, Timestamp]...

Automapper : mapping issue with inheritance and abstract base class on collections with Entity Framework 4 Proxy Pocos

I am having an issue using AutoMapper (which is an excellent technology) to map a business object to a DTO where I have inheritance off of an abstract base class within a collection. Here are my objects: abstract class Payment class CashPayment : Payment class CreditCardPayment : Payment I also have an invoice object which contains a...