Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different screen resolutions
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00136440
Message ID:
00137146
Views:
23
>You would not want a textbox *class* and a listbox *class* to have interdependencies, but at the instance level it is completely legit. You use a mediator to minimize the number and aid the maintainability of these dependencies.
>
>Make sense?

Yes, I agree that you absolutely want to minimize dependencies between classes, and indeed there should be none at all between a listbox and a textbox class (unless they're both inside a container, and have been subclassed for that specific reason).

But I don't understand why you'd want to use a mediator to minimize the number and aid the maintainability of dependencies between instances when they depend on each other logically, yet rely on their direct knowledge of each other when it comes to repositioning themselves.

As you know, I think a mediator is undesirable in the former case, yet is necessary in the latter case (if only for aesthetics).

Wouldn't it be best to have the form (==mediator) position the buttons when the form is resized, instead of having each button say "OK, let me just enumerate through ThisForm.Controls to see what other buttons there are, and where I fit in the tab order. OK, I'm next to a Help button, and after he's finished repositioning, he'll be at 140, 240. Lemme see, the form is probably using an interbutton spacing of 8 pixels, so I'll just squoonch myself up beside that Help button. Gee, I sure hope that button really is the closest to me... Maybe I'd better..."

Or worse: "OK, on _this_ particular form, I _know_ the help button is right beside me. I don't know if he's been repositioned yet or not, so what the heck, I'll just use his "canonical position" when he was first dropped on the form..."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform