coupling child/parent classes

From: Pamela G. (antispamid2003_at_yahoo.com)
Date: 03/31/04


Date: 30 Mar 2004 14:50:29 -0800

Hi,
I am in the process of designing a GUI application using wxWidgets's
doc/view framework (formerly wxWindows: http://www.wxwidgets.org).

The coupling between the various components in the doc/view framework
is pretty strong - they *all* need each other, a problem that has been
solved by placing all these classes in one file...

I am trying however to design my application in such a way that there
is minimum coupling/knowledge between *my* classes (some are derived
from the framework's classes), despite the interdependencies inside
the framework.

For example, up until this stage I succeeded in creating a view class
and a parent frame class (the frame is said to contain the view), in
which the frame "knows" about the view, but the view doesn't know
about the frame.

I like this simple "containment" relationship :)

However, while trying to implement some more complex functionality in
the application, I ran into a situation were the view needs to know
about the frame. That is, a #include <frame> in the view.cpp module.

(note: I have no cyclic #include's in header files. I am mainly
interested in the conceptual/principal aspect of the design - with
practical maintainability/extensibility implications, of course)

Since I am not that experienced in the world of design models and
patterns, I would like to ask the gurus among you: Is this kind of
inter-dependency ("inter-knowledge") acceptable in a good OOD
application design?

I know that *ideally* no software component should need any other
software component, but we all know about the model/view/controller
pattern in which you can't use one class/module without requiring the
other two. Why can't I apply this principle to to the view/frame
modules?

I am curious to learn about other people's experience, whether you ran
into a similar situation and what was your approach/solution.

Thanks in advance,
Pam



Relevant Pages

  • Re: coupling child/parent classes
    ... >The coupling between the various components in the doc/view framework ... >I am trying however to design my application in such a way that there ... >and a parent frame class, ... See "The Dependency Inversion Principle" at this location: ...
    (comp.object)
  • Re: Unix and OO Avoidance
    ... >those tools and techniques have not been applied. ... >device independence of the IO drivers in unix is a form of OO design. ... >Many well structured programs in C make use of dynamic binding to help ... >>fragmented is that the coupling of the modules is too high. ...
    (comp.object)
  • Re: Response to Bajajoes StowAway2 Cargo Carrier Review
    ... I'll repost my original review in this thread. ... Some of the potholes on I-880 probably exceed the design ... The frame support under the box is flimsy. ...
    (rec.outdoors.rv-travel)
  • Re: Robert Bussards approach to fusion
    ... developing an approach to fusion called inertial electrodynamic fusion. ... So many years later I finally figured out a design to compete. ... Given the postulate of inertial frame effect, ... A cause to charge as effect required charge ...
    (sci.physics)
  • Software PS RIP and DTP Package for Windows!!!
    ... Support complex font curves that enable the users to use Professional ... Chinese typesetting can design advertisements and posters of Chinese ... Can print CAD graph with super length, the longest is 50 meters, ... Auto-Creat Title Frame ...
    (comp.publish.prepress)