Print Page | Close Window

DomainModel for Multiple Client

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2858
Printed Date: 13-Apr-2026 at 7:43am


Topic: DomainModel for Multiple Client
Posted By: Vonzkie
Subject: DomainModel for Multiple Client
Date Posted: 01-Aug-2011 at 11:31pm
Hi,

To give you an overview of our Company's project, we need to have a Data Access Layer
that can be distributed to different .NET Clients such as Silverlight, WPF, Winforms.

I was able to create an n-tier Windows Form application using Devforce by separating 
the DomainModel class with the WinForm Project and accessing it in 2-tier or n-Tier
mode by enabling the "Distributed" property on the App.Config.

Same as true with the Silverlight project, by using the Devforce Silverlight Template.

But what I want to accomplish is to reuse the DomainClass I created in the Windows forms 
Application and use it with my Silverlight project.

How can I do that? How can I generate the client-side generated code by just reusing 
the existing DomainModel class?

Hope you can help me guys.

Thanks,
Von



Replies:
Posted By: robertg
Date Posted: 02-Aug-2011 at 2:19pm
Von,
 
I think that there are probably a number of ways to do this, any of which would be acceptable. This is how I would do so...
 
1) Open the solution that I'm going to use as the foundation for this.
2) Add a new project for the second client that I'm adding to the solution.
3) Change the default namespace for my new project to match the namespace for my old project.
4) Add a "Shared Code" folder to my new project.
5) Add a link to any code I want to share (Add -> Existing Item -> Select File -> Change from "Add" to "Add as Link"
 
I'm I'm correct that your main concern would be managing your code without having to sync multiple copies of your DomainModel class, or trying to keep track of homing it in multiple places, this should solve your problem. If you don't want to keep your projects in one solution, you should be able to add links to  your existing code files in other solutions, in the same way as 5) above.
 
Yours,
Robert


Posted By: Vonzkie
Date Posted: 02-Aug-2011 at 7:51pm
Hi Robert,

Thanks for the reply. 
That answers my need. :)

Regards,
Von



Print Page | Close Window