Re: Should this be an object?
- From: "Larry Serflaten" <serflaten@xxxxxxxxxxxxxx>
- Date: Fri, 22 Jun 2007 08:07:06 -0500
"MP" <NoSpam@xxxxxxxxxx> wrote
does this seem like the right direction to head?
No.
Turn 180 degrees and start thinking about how you can
de-couple your objects from everything else. You don't
really want them to know about the outside world, any more
than you want to require the outside world to know how your
object works.
The less code they are 'required' to include in 'handling' eachother
the better....
As others have said, if its text that needs to be displayed,
then offer a function to return the text. If it is something
to be drawn, then you might pass in the hDC or other canvas
on which to draw itself. It could care less if that 'canvas' is a
form, picturebox, or printer, etc... And the code that calls on
the object to draw itself, doesn't care how it does it, as long as
it draws itself to the place indicated by the passed in hDC or
other canvas. (form, picturebox...)
LFS
.
- Follow-Ups:
- Re: Should this be an object?
- From: MP
- Re: Should this be an object?
- References:
- Should this be an object?
- From: MP
- Should this be an object?
- Prev by Date: Re: Timers just stopped working
- Next by Date: Has anyone every seen this problem before or have any ideas?
- Previous by thread: Re: Should this be an object?
- Next by thread: Re: Should this be an object?
- Index(es):
Relevant Pages
|