Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7732959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:51:46+00:00 2026-06-01T06:51:46+00:00

We are going to be developing a large enterprise desktop application very soon and

  • 0

We are going to be developing a large enterprise desktop application very soon and i have been spending some time researching the WPF + PRISM + MVVM approach, i have got a good grasp on most of the concepts and am loving the modularity it provides.

Where i am having problems is with how to architect the services layer to get data in and out, especially when this service is introduced by a module with the idea that dependant module can use it.

I wanted to abstract my WCF data services inside of application services and use ServiceLocator to resolve concrete instances from within my view-models, however im having a hard time working out how this should hang together, mainly due to my entites being part of the WCF service.

For example

Module1
Contains WCF Service + Concrete Application Service(ISearchService) + WCF Service generated entities(model)

Module1.Infastructure – Contains the following interface for the application service

public interface ISearchService
{
      ObservableCollection<Person> Search(string search);
}

this would be registered in the UnityContainer so that any other module can get the concrete implementation introcuded by the module.

My problem is that the Entities (Person) are defined in the module itself (in the WCF service), so introducing a service and then expecting any other modules to be able to use it means they need to reference the module itself not just the modules infastructure, unless i pull out the services into another assembly.

Should i be exposing my entites that are auto generated from my EF model in this way?

Does anyone have a better solution ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:51:47+00:00Added an answer on June 1, 2026 at 6:51 am

    Here is how did it.

    I’m currently using Silverlight + PRISM + MVVM + WCF (RIA) services.

    With the current project architecture

    • Application.Domain : Containing all the EF code first entities including metadata and business validation. Does not include database generation.
    • Application.RIAServices : This is the project that contains the auto generated classes from WCF RIA services web project. I can reference this project in both WPF and Silverlight.

    • Application.RIAServices.Web : Webproject containing the DomainServices and database generation code by using the DbContext. this is the WCF RIA link project for Application.RIAServices

    • Application.Infrastructure : This is where it starts. Because just like you I have a Person/Customer Service using an interface ICustomerService. Because I want to use this service for example application wide and not only in the ModuleA, I place this interface in the Infrastructure. All projects contain a reference to this project.

    • Application.Modules.ModuleA –> Application.Modules.ModuleD : General modules providing functionality. All of my modules (that use WCF RIA Services) have a reference to the Application.Infrastructure and Application.RIAServices projects.

    • Application.Shell : Startup project. having the bootstrapper and registering all relevant modules.

    Reading Rachels question made me think about certain things and I just wanted to leave my structure on how I did it. You might have an idea about it. I Don’t want to go to DTO yet because things like validation are so good intregrated in WCF RIA services that it automaticly reflects in the textbox when something is wrong and displaying an error message. Looking forward to hearing your opinion and the outcome of the question/issue

    Edit:

    Application.Domain also has a separate structure aswell.

    I have my Models. Only container pure properties that need to be mapped to the database. Then I have my Metadata folder. Now for this to work I need to have the same namespace as my Entity and I make the entity partial. I create a Entity.metadata.cs file and in there I create a internal sealed class EntityMetaData, Copying the properties and adding attributes to it them. By using the MetadataType attribute above the Entity class it adds all those attribute to the EF/WCF RIA code generator.

    One of those attribute is the CustomValidation it use a static class and a method paramater and validates the entity on the server. Or if you create the file with a .shared.cs extension it gets generated to the Application.RIAServices project.

    Possibility

    To try to answer your question, you might have only 1 option and that is what you suggested at first. You can create a Customer.Infrastructure Project.

    this project contains the interface for the ICustomerService, the Entity/DTO/POCO what ever you want, and maybe even a implementation of this ICustomerService or the WCF service. This then allows all your modules to reference this project and thus not creating dependecies between modules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're developing a large desktop application using Windows Presentation Foundation. Currently, the application is
I am going to be developing a large project which will include a large
I'm developing a web application that is going to be served from an OSGi
Right now I'm developing the prototype of a web application that aggregates large number
I am going to be developing an application for work, and I am trying
One of our teams is going to be developing an application to store records
I am currently developing a page with a very large and focal background image
I'm developing an application that's going to be implemented as a Windows Service and
I'm starting a new job soon where I'm going to be developing in Ruby
I am developing an application that uses Entity Framework and WPF with MVVM design

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.