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

  • SEARCH
  • Home
  • 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 6082979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:20:57+00:00 2026-05-23T11:20:57+00:00

We have several (5+) applications that hit the same database and we’re running into

  • 0

We have several (5+) applications that hit the same database and we’re running into issues where the applications all take it into their own hands to build queries that fetch the same data. However, since different developers are creating these queries they’re not identical as they should be, thus returning different results from time to time.

As far as I can see there are 2 possible solutions.

  1. Create a library that each application references to get the proper query
  2. Create a WCF service that encapsulate common queries used by each application and create a client for each application to use

I’m leaning towards option 2 since this would give us the flexibility to modify the filters we’re using in our queries, thus updating each application at once.

The service hierarchy would look something like

public class QueryService
{
    private readonly IRepository _repository;

    public QueryService(IRepository repository)
    {
        _repository = repository;
    }

    public IEnumerable<int> GetCommonOperation()
    {
        return _repository.GetCommonOperation();
    }

    public IEnumerable<AnotherDto> AnotherCommonOperation()
    {
        return _repository.AnotherCommonOperation();
    }
}

Then create a client that would interact with QueryService.

So my question what is the general approach for creating querying services with the sole goal of encapsulate commonly used queries/operations for several applications?

  • 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-05-23T11:20:58+00:00Added an answer on May 23, 2026 at 11:20 am

    You’ve already answered your own question. Essentially, you want to seperate the interface from the implementation, just as a web service (or WCF) would accomplish. If you create an assembly, you’ll still need to ensure that the assembly is deployed with your seperate clients, or at least in a location that is accessible by any application utilizing it. Seems like a lot more work. However, keep in mind, if you make changes to the service signatures, any client utilizing that service will also have to update to reflect the new definitions.

    The great thing about a web service (WSDL) is that it’s generic. You can write the client’s in any language that can consume and parse WSDL — unlike an assembly, where you would be targeting a specific build or OS. So whether you have C#, Java, iOS, Android, etc. clients, they are all capible of utilizing your services.

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

Sidebar

Related Questions

I have several .NET Windows Forms applications that I'm preparing to convert into a
We have several applications that are installed in several departments that interact with database
I have several applications that are part of a suite of tools that various
We have several .NET applications that monitor a directory for new files, using FileSystemWatcher.
I have several different c# worker applications that run various continuous tasks: sending emails
I have several web applications in production that utilize NFS mounts to share resources
We have a piece of functionality that is used by several different applications (clients)
I've run into a problem that I'm certain others have hit and solved. In
We have several applications that use Apache HTTPClient 3 to make HTTP requests. Recently
I have several mini wars that are modules of a larger application running on

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.