473,386 Members | 1,610 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,386 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 1392
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.