What if you need to create POCO objects from a dbml file? Do you use a generator and who? You write the POCO's manually?
Say you like to make your objects Persistent Ignorant and share to clients, then create a DAO pattern for the communication between Client – DAO – L2S Objects, this is a question for disconnected design using Linq 2 SQL. Supposed that the POCO's using the client should be as much as primitive as they can be without dependencies (EntityRef<>, EntitySet<>, Attributes, etc.), and ofcourse you could cast the L2S object into the POCO with the appropriate DATA.
Any help and any corrections on the concept would be really helpful!
C# – Linq-to-SQL Design question!
Architecturec#-3.0design-patternslinq-to-sql
Related Topic
- On design patterns: When should I use the singleton
- Does functional programming replace GoF design patterns
- The difference between Builder Design pattern and Factory Design pattern?
- C++ Singleton design pattern
- Java – Examples of GoF Design Patterns in Java’s core libraries
- .net – LINQ: When to use SingleOrDefault vs. FirstOrDefault() with filtering criteria
Best Answer
I would be tempted to say "wait until EF in .NET 4.0", which has much improved POCO support (compared to EF current) and hopefully a POCO T4 template in VS2010.
At the moment SqlMetal will emit rich objects; while LINQ-to-SQL can work on POCO types, you would have to write the POCOs yourself, or use xslt / T4 / whatever on the dbml.