473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Design Question

Hello,

I have several manuals for which I'm developing a query tool. There will be
others that need to be plugged in sometime in the future. To streamline the
integration of those manuals in the future, I would like to make my interface
seemlessly know all the manuals currently available at any given time. I have
what I think is a pretty good foundation design but it lacks the ability to
use intellisense and I'd like advice on how to approach this issue.

I currently have developed a DLL project that contains properties and
methods generic across all manuals. I've also developed a DLL project for
each of the individual manuals to handle properties and methods unique to a
given manual.

The generic project has virtual classes with mustinherit methods and
protected properties. Those classes will be inherited by each of the manual
specific project classes.

I think the best way to seemlessly integrate new manuals if by using
createobject with the progid of the user specific manual stored in an xml
file. So, I use CreateObject to instantiate the manual specific classes into
a variable of the generic class type to get intellisense help with the
properties and methods that are consistent across all manuals. Because I get
the combo boxes loaded via an xml file and other important information, such
as the progid for the CreateObject from the xml file, I have architected this
app to seemlessly accept manuals as they are developed.

Unfortunately, because I use CreateObject for the manual specific classes, I
can't seem to design an architecture that will provide me the seemless
integration and the intellisense for development.

Any advice?

Jack

Nov 21 '05 #1
4 1389
I think you would be better served by creating an Interface and have
each of the specific manual .dll's implement that interface.

That makes it easy to add more manuals and the app does not have to be
recompiled to be able to load those .dll's. Also, since the app
references the interface, you get intellisense when working with the
interface.

Instead of using CreateObject, you just dim an object of the Interface
type.

For example:

'Interface definition
Public Interface IManual
sub ShowManual()
End Interface

'Manual 1 .dll
Public Class Manual1
Implements IManual

Public Sub ShowManual() Implements IManual.ShowManual
'Code to show manual here
End Sub
End Class
'In the app, you can use this code:

Dim Manual as IManual 'Note it is using the Interface here

'Code to load the .dll with the correct manual and assign it to the
Manual variable

Manual.ShowManual
You can use reflection to query .dll's to see if they implement the
interface or you could have a folder which contains all the manual
..dll's and just load them from there.

Hope this helps

Chris

Nov 21 '05 #2
Thanks for the response, I appreciate it.

That sounds promising. The only thing is that using interfaces will require
me to create a new one everytime a manual with unique properties and/or
methods is added to the application. Thus the application will need to be
recompiled each time a new manual is added. Am I reading your suggestion
correctly?
"Chris Dunaway" wrote:
I think you would be better served by creating an Interface and have
each of the specific manual .dll's implement that interface.

That makes it easy to add more manuals and the app does not have to be
recompiled to be able to load those .dll's. Also, since the app
references the interface, you get intellisense when working with the
interface.

Instead of using CreateObject, you just dim an object of the Interface
type.

For example:

'Interface definition
Public Interface IManual
sub ShowManual()
End Interface

'Manual 1 .dll
Public Class Manual1
Implements IManual

Public Sub ShowManual() Implements IManual.ShowManual
'Code to show manual here
End Sub
End Class
'In the app, you can use this code:

Dim Manual as IManual 'Note it is using the Interface here

'Code to load the .dll with the correct manual and assign it to the
Manual variable

Manual.ShowManual
You can use reflection to query .dll's to see if they implement the
interface or you could have a folder which contains all the manual
..dll's and just load them from there.

Hope this helps

Chris

Nov 21 '05 #3
You might wish to check out the Adapter design pattern. I think you
could define a common interface that would handle the majority of the
manuals but for those that require special treatment, use the Adapter
pattern to create a dll that can translate between the interface and
the manuals that have non standard interfaces.

Without knowing more about how the manuals differ, it's difficult to
visualize.

Nov 21 '05 #4
I'll check into it. Thanks a lot for your advice. I really appreciate it!

"Chris Dunaway" wrote:
You might wish to check out the Adapter design pattern. I think you
could define a common interface that would handle the majority of the
manuals but for those that require special treatment, use the Adapter
pattern to create a dll that can translate between the interface and
the manuals that have non standard interfaces.

Without knowing more about how the manuals differ, it's difficult to
visualize.

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
19
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design...
8
by: indrawati.yahya | last post by:
In a recent job interview, the interviewer asked me how I'd design classes for the following problem: let's consider a hypothetical firewall, which filters network packets by either IP address,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.