On Dec 19, 2007 5:05 PM, Paul McNett <[EMAIL PROTECTED]> wrote:
> Ed Leafe wrote:
>
> > On Dec 19, 2007, at 4:32 PM, Bill Anderson wrote:
> >
> >> In my mindset, those two controls should be in a container (VFP
> >> speak) and
> >> communication directed to the container, then subclass the
> >> container as need
> >> be.
> >>
> >> As you indicate, this can be considered overkill.
> >>
> >> Nevertheless, that's how I'd do it.
> >
> > Keep in mind, though, that the purpose of communicating through a
> > "common" reference (mediator pattern) is to avoid tightly coupling
> > the objects. But if you are designing a custom class, the objects are
> > by definition pretty tightly coupled, so using a mediator really is
> > superfluous.
>
> I say, do it the way that feels right, and get it working as fast as
> possible. Then, refactor to make it right.
>
> Make it work, then make it right. Then, make it fast, but that's a
> different topic altogether.
I second that notion...If you would look over my shoulder as I code an
app, I code it rather horribly the first time. It is generally
implementation specific, not refactored, very ugly code. But then
after you get it working you go back and you refactor it. Optimizing
("making it fast") is just another refactor, but it shouldn't be done
at the expense of clean code...
Note too that several standard design patterns don't apply to Python
because of the nature of the language. For example, a factory pattern
is non-existent in Python because the language implements it itself.
However, there are some patterns like the observer pattern that seem
to work well, especially in a plugin environment.
Also, one thing Paul forgot to mention is get a basic implementation
working first. Say you are coding an application to that manages
inventory, orders, and customers...Well, start with the customers
first and get a basic app that talks with the database and displays a
list of customers. Then, add in the ability to edit customer data.
Then add in the ability to add and delete customers. Then add
searching. Remember that a big problem is like an elephant. In order
to eat it (solve it), you need to take it one bite at a time.
Cheers,
Nate L.
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]