Design Puzzle!

D

dwa

A general .NET releated design question:

Short Verssion:

What is the best way to have a data access layer target a different database
at run-time, without having to pass in some identifier or string to select a
database?

Background:

Many of our clients have very similar database processing requirements:
users, logins, products, product lines, etc., and we've been able to design
a generic database that works across a wide variety of business domains.
Along with this, we have data access components, of course. When we deploy,
we put a different instance of the database in place for each client, but
would like to re-use the same data access components for each application.

I thought about setting a variable in the AppDomain with SetData, which
could be referenced in the data access layer, but I'm not sure this will
work if the call into the access layer is remoted (?)

1. If we make a call into a remoted object, say on a different machine, does
that call run under the AppDomain of the caller? (my guess would be "no"
but...)

2. Is there some other context that we can use to determine the application
that is calling it?

Thanks,

- da
 
C

Cowboy \(Gregory A. Beamer\) [MVP]

I pass in the info, but I have created a methodology that uses either
web.config or the Config Management block to store a variety of strings for
different types of servers. One way or another, some form of config
management is the key.

Remoting? You are correct. Not in the context. You can build a mechanism to
change this, but it is a pain. Component Services is the easiest option to
distribute an app and have it stay in the context of a single domain user.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top