Otis wrote:
Yes we do have lotteries, no I never win anything in them
Seriously though: You cao do this. You can automate this btw. In the designer, you can specify additional interfaces for an entity. You can specify a macro there so you don't have to re-type the entity name. With some additional templates, you can generate the interfaces in separate files and be done with it .
Keep in mind that it is actually pretty much overkill, as the interface might give you loose coupling, but that doesn't mean your logic and your software isn't coupled to the persistence framework used. That's the fallacy of 'persistence ignorance' or 'poco': it doesn't exist: your software relies on the aspects of the persistence framework used, how it queries, how it manages entity graphs in memory, how you can persist graphs etc.
I'm also quite interested in this approach. I spent a few years at clients & projects where i couldn't convince the client to use LLBGen, and was forced to use nHibernate & Linq2Sql (although in my last week at the previous client, they intended to review LLBLgen - and i KNOW once they take a serious look at it, they won't ever use anything else again
But now i'm at a new client, greenfield project (WPF smartclient). I'm relatively new to WPF, only did some small stuff, but I am confident that it's really cool and convinced that i'm gonna like it.
I am also in the position to convince the client to use LLBLgen for their datalayer (on oracle10g), and will probably choose the adapter paradigm.
My idea is to design it so that the smart client will use WCF to fetch entities from the backend. Now i thought it might be a good idea to make interfaces for the entities, and let WCF return those. That way we can eliminate every dependency to llblgen in the smart client project.
So my question : are there "out of the box" templates for generating these interfaces ? So that for an CustomerEntity we could generate an interface:
public interface ICustomer
{
string Name {get;set;};
string LastName {get;set};
IList<IOrder> {get;} // <-- is this even possible due to co-variance ?
//etc
}
On a last project, we didn't use interface for our business objects, but we just wrapped every linq2sql generated entity in a "domain object"...the constructor of the domain object took the entity as argument, and copied all properties. Lots of manual coding & maintenance
Any other thoughts on how to tackle my problem ?
On a side note, things like http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15204&HighLight=1 frighten me a little bit and make me wonder is my approach is gonna work in the long run ..it's a several man-year budgetted project, and my ass could be on the line here