PrestwoodBoards: www.PrestwoodBoards.com

www.prestwoodboards.com

Code decides on what class/component to use

Code decides on what class/component to use in C# & WinForms topic (part of our C# (Visual C# & VS.Net) group).

Quick Search: decides   class/component   Code decides   Code decides what   class/component use  
adlerhealthcom@webtv
 (Inactive)
Tuckahoe N>Y>
I am developing an application in C#. A feature I want to insert is to have the code choose what objects to use.

The following scenario should make the question more clearer:
Lets say I was developing a kiosk application for software retailers that would allow instore shoppers to browse and find products faster. We will assume this application will be a boxed package. Since its a prepackaged program, it has to be set up with no customization to the program itself. There will be only one release. (I understand that with the new model of distributed programming, this wouldn't be appropriate, but just to get the point across, lets take everything as face value).

The point is, the software can't be customized by me every time a new client makes a purchase.

The retail industry is diverse in data storage models. This posses some problems. One firm might be using a SQL Server connected to the retail chain headquarters. Another firm might be using a proprietary program that just tracks inventory.

Lets say the main function of my application is to act as a user friendly kiosk. I don't want people to buy whole new systems when purchasing my software. I want my software to adapt to whatever data source they have.

So when I ship the application, it would have "adapters" that would translate what my application is requesting.

Lets assume we have a list of all the available adapters in an xml file. This file can be updated using an admin panel if we introduce support for more data sources.

Now comes the meat of the question: How do I get my main application to communicate with these adapters?

Here are the key assumptions:
* The main application has a string variable with the name of the class as the value.
* All the adapters support the same functions, i.e. getAll(), getByType(), etc.
* All the adapters have a common namespace.
* The adapters themselves are complex business objects that perform stuff we don't want to look at.

Any input on this problem would be appreciated. Please feel free to forward this to anyone you thing who could help me. Thank a lot.

Melvin Ram
micheal10@hotmail.com
About adlerhealthcom@webtv -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #5661, 1 replies
Thread Started 3/28/2002 1:43:00 PM
View Counter=2766
Last Reply Posted 3/30/2002 8:30:00 AM)
Location=Tuckahoe N>Y>  
Joined=7/12/2002   MB Posts=1  
Most Recent Post
cheddar
Lodi, CA
so let me see if I understand. You front end application wont change from client to client but you intend for it to persist or read from their existing datastore? If this is the case you will need to write a mapping program for the client to use. Ideally this app would take the connection information from them. You would have them specify the db name, the db type and user information. The app would them retrieve the schema from the db. Then the user would need to map from the data entities represented in your application to the tables in their database.

This would be alot of work. Another option would be to save the data in your own database but use a message queue to hold the data prior to submission. Then your customers could read the queue as well and do with the data what they will.
Eric Neff
C#, ASP.Net, SQL Server, Oracle
About cheddar -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #5669 (Level 1.1)  Reply to 5661
Thread Started 3/30/2002 8:30:00 AM
View Counter=2
Location=Lodi, CA  
Joined=7/9/2001   MB Posts=88  
www.prestwoodboards.com
Copyright (C) Prestwood IT Solutions.
All Rights Reserved.
Printed 7/23/2019