Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 25th, 2005, 05:35 PM
Mark Stijnman
Guest
 
Posts: n/a
Default Connections

I have a hierarchy of classes that need to be able to be connected to
each other. It consists of an Abstract Base Class, and a set of
descending classes, A, B, C and D. As connections have properties too
(such as the angle between the objects it connects), it will be
modelled as a separate class Connection. I am still deciding whether I
will make Connection templated over the type of objects it connects -
probably I won't. At any rate, I want each object descending of Base to
accept two connections, one incoming at the start, one outgoing at the
end (Connections are oriented, just like the objects they connect).
Unfortunately, not all combinations are valid. Objects of class A
cannot connect to another object of class A, for instance. How would I
implement this neatly? How would I define the virtual methods in Base
to reflect the demand that all descandants of Base should be able to
accept or make connections? How would the methods in the descending
classes be defined, to only make or accept connections in valid
combinations? Any standard design patterns I should look up for this?
Thanks for any tips.

regards Mark

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles