473,385 Members | 1,555 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,385 software developers and data experts.

Is this a viable design idea?

I have an order processing application with many features.
I want to be able to put some features in external and configureable
DLLs.
The main application has to pass an order object (and possibly some
other objects) to the external dll.

I have designed a base class with just interfaces on which the real
dlls base. The main application has a reference to this base class.
The external dlls (and the base class) need a reference to the main
application so it can properly use the classes that are passed from
the main application to the external dlls.

Since the main app has a reference to the external dlls and the
external dlls have a reference to the main app this looks to me like
circular reference.

Can I get into trouble with this design? Is it better to move all the
classes to a separate dll and reference this dll from the main
application and the external dll?

Any comments welcome

Tosch
Jul 21 '05 #1
4 1320
I bet you already answer the question. Only set reference to dll(s).

chanmm

"Tosch" <to**********@swissonline.ch> wrote in message
news:7s********************************@4ax.com...
I have an order processing application with many features.
I want to be able to put some features in external and configureable
DLLs.
The main application has to pass an order object (and possibly some
other objects) to the external dll.

I have designed a base class with just interfaces on which the real
dlls base. The main application has a reference to this base class.
The external dlls (and the base class) need a reference to the main
application so it can properly use the classes that are passed from
the main application to the external dlls.

Since the main app has a reference to the external dlls and the
external dlls have a reference to the main app this looks to me like
circular reference.

Can I get into trouble with this design? Is it better to move all the
classes to a separate dll and reference this dll from the main
application and the external dll?

Any comments welcome

Tosch

Jul 21 '05 #2
It would be a circular reference.

Assuming the following assumptions are correct then the subsequent
suggestion could be of use to you:
1) You are using the Base class as a means to expose a limited interface to
your main application.
2) Your Order object is used BY your external dll, and your Order object
does not need a reference to
your external DLL.

Suggestion:
1) Take your Order Objects out of the Main App and put them in Order.dll
2) Add Reference to Order.dll in Main App
3) Add Reference to Order.dll in your existing 'external' dll

= No Circular References.

Also if the Base Class is just an interface then consider creating an
Interface and using Implements in your
external DLL Classes.

Hope this helps some
Neil
"Tosch" <to**********@swissonline.ch> wrote in message
news:7s********************************@4ax.com...
I have an order processing application with many features.
I want to be able to put some features in external and configureable
DLLs.
The main application has to pass an order object (and possibly some
other objects) to the external dll.

I have designed a base class with just interfaces on which the real
dlls base. The main application has a reference to this base class.
The external dlls (and the base class) need a reference to the main
application so it can properly use the classes that are passed from
the main application to the external dlls.

Since the main app has a reference to the external dlls and the
external dlls have a reference to the main app this looks to me like
circular reference.

Can I get into trouble with this design? Is it better to move all the
classes to a separate dll and reference this dll from the main
application and the external dll?

Any comments welcome

Tosch

Jul 21 '05 #3
Neil,
thanks for your comments.
The base class is indeed just an interface and the 'real' external
DLLs implement that interface.
The way I have designed it now (with circular reference), it does
acutally work, except for a warning when compiling. But it just
doesn't feel right.
I will put the order object and any objects that I pass between the
main application and the external DLLs in a separate DLL, just seams
cleaner to me too.

Tosch
On Thu, 29 Jul 2004 17:29:39 +0000 (UTC), "Neil Woodvine"
<nR****************@btEinternMet.cEom> wrote:
It would be a circular reference.

Assuming the following assumptions are correct then the subsequent
suggestion could be of use to you:
1) You are using the Base class as a means to expose a limited interface to
your main application.
2) Your Order object is used BY your external dll, and your Order object
does not need a reference to
your external DLL.

Suggestion:
1) Take your Order Objects out of the Main App and put them in Order.dll
2) Add Reference to Order.dll in Main App
3) Add Reference to Order.dll in your existing 'external' dll

= No Circular References.

Also if the Base Class is just an interface then consider creating an
Interface and using Implements in your
external DLL Classes.

Hope this helps some
Neil
"Tosch" <to**********@swissonline.ch> wrote in message
news:7s********************************@4ax.com.. .
I have an order processing application with many features.
I want to be able to put some features in external and configureable
DLLs.
The main application has to pass an order object (and possibly some
other objects) to the external dll.

I have designed a base class with just interfaces on which the real
dlls base. The main application has a reference to this base class.
The external dlls (and the base class) need a reference to the main
application so it can properly use the classes that are passed from
the main application to the external dlls.

Since the main app has a reference to the external dlls and the
external dlls have a reference to the main app this looks to me like
circular reference.

Can I get into trouble with this design? Is it better to move all the
classes to a separate dll and reference this dll from the main
application and the external dll?

Any comments welcome

Tosch


Jul 21 '05 #4
Tosch,

FYI, your app will work fine with circular references ... for a while. With
circular references (A>refs>B>refs>A) even after your app appears to have
closed down, the objects will remain alive in memory (that cannot be
accessed again) until you restart your machine.

This is a memory leak.

Therefore, if you use your app multiple times without restarting you'll
eventually use up all your memory.

Try adding some Logging code to your Class_Finalize method and you'll see
the difference between closing your app with circular references and closing
your app with non-circular references.

Cheers,

Neil

"Tosch" <to**********@swissonline.ch> wrote in message
news:4l********************************@4ax.com...
Neil,
thanks for your comments.
The base class is indeed just an interface and the 'real' external
DLLs implement that interface.
The way I have designed it now (with circular reference), it does
acutally work, except for a warning when compiling. But it just
doesn't feel right.
I will put the order object and any objects that I pass between the
main application and the external DLLs in a separate DLL, just seams
cleaner to me too.

Tosch
On Thu, 29 Jul 2004 17:29:39 +0000 (UTC), "Neil Woodvine"
<nR****************@btEinternMet.cEom> wrote:
It would be a circular reference.

Assuming the following assumptions are correct then the subsequent
suggestion could be of use to you:
1) You are using the Base class as a means to expose a limited interface toyour main application.
2) Your Order object is used BY your external dll, and your Order object
does not need a reference to
your external DLL.

Suggestion:
1) Take your Order Objects out of the Main App and put them in Order.dll
2) Add Reference to Order.dll in Main App
3) Add Reference to Order.dll in your existing 'external' dll

= No Circular References.

Also if the Base Class is just an interface then consider creating an
Interface and using Implements in your
external DLL Classes.

Hope this helps some
Neil
"Tosch" <to**********@swissonline.ch> wrote in message
news:7s********************************@4ax.com.. .
I have an order processing application with many features.
I want to be able to put some features in external and configureable
DLLs.
The main application has to pass an order object (and possibly some
other objects) to the external dll.

I have designed a base class with just interfaces on which the real
dlls base. The main application has a reference to this base class.
The external dlls (and the base class) need a reference to the main
application so it can properly use the classes that are passed from
the main application to the external dlls.

Since the main app has a reference to the external dlls and the
external dlls have a reference to the main app this looks to me like
circular reference.

Can I get into trouble with this design? Is it better to move all the
classes to a separate dll and reference this dll from the main
application and the external dll?

Any comments welcome

Tosch

Jul 21 '05 #5

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

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
1
by: Paul Stanial | last post by:
How viable is it to use MS Access as a front end (via ODBC) to a SQL Server 2000 database? The users would access via the internet using a netgear vpn setup. Thanks, Paul S
25
by: John Morgan | last post by:
Though I have designed and implemented a number of large reasonably well received web sites I do not consider myself a graphics designer I am now for the first time going to work with a ...
4
by: Tosch | last post by:
I have an order processing application with many features. I want to be able to put some features in external and configureable DLLs. The main application has to pass an order object (and possibly...
1
by: paul.drummond | last post by:
Hi all, I am new to whole idea of "web services" and architectures such as .NET and J2EE so please bare with me. I am trying to research as much as possible before asking silly questions but...
2
by: David Williams | last post by:
Hi Guys, I have a couple of problems. The first is (I believe) a simple syntactic problem you can probably solve quite easily. The second is a design style problem which might be more tricky... ...
5
by: A_M_IS | last post by:
Dear valuable experts, I truly hope than You can suggest for me Your ideas how to resolve design. I developing relative small Access VB tool, for single user use only. Access version 2003, but db...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
37
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.