Re: A question of size.. size matters :)

From: Alisdair Meredith [TeamB] (alisdair.NO.SPAM.PLEASE.meredith_at_uk.renaultf1.com)
Date: 12/29/04


Date: 29 Dec 2004 02:05:50 -0800

Liz wrote:

> If you have a project. With hiddious naming convetion to prevent me
> from think that goes
>
> Form1 which is an MDI form
> Form2 whcih is an MDI child
>
> Obviously, form2 is the grunt of the app.
>
> If I have a routine that will be running on Form2, which I dunno, goes
> through and highlights all the word "delphi" for want of something
> better to do. Or caculates various values anyway, some grunt task..
>
> Is this more memory efficient being on the MDI form and thus in
> existance once, or on the child form, what are the pros and cons for
> each??

Generally speaking, the grunt-work should not be done in your form at
all, but in another unit dedicated to the application logic <g>
Separating out the 'presentation layer' (or UI) from the grunt work
leads to a much 'cleaner', more flexible design. It is also easier to
look into your optimisations, as you are no longer worried about UI
issues when handling the core logic (UI is rarely the performance
bottleneck)

Other than that, it would rarely make a measurable efficiency
difference if you put the calls into the MDI frame or child - unless
you have 100 children or something really unusual. Best to put the
logic where it most ready belongs - one the child if manipulating the
child form, or the frame if manipulating elements of that form. If you
split the logic into a separate unit as suggested, and apply the
observer pattern, you might end up with logic on both forms!!

AlisdairM(TeamB)



Relevant Pages

  • Re: disable restore contorl for mdi child forms
    ... completely fill the MDI form's display area and not be resizable. ... Where as the main mdi form can be restored. ... You want the Child forms to fill the entire client area ... Set the ControlBox Property of each child -False ...
    (microsoft.public.vb.general.discussion)
  • Re: multiple form toggle
    ... > Each child form receives user input and calculates these ... Public properties) to cache the data for each form. ... Add a textbox to Form2. ... Private Sub Form_Click ...
    (microsoft.public.vb.controls)
  • Re: Controls on MDI Parent Form
    ... The controls on the MDI form ... on the MDI parent form invisible to its child forms?? ...
    (microsoft.public.dotnet.framework.windowsforms)
  • RE: Calling parents functions
    ... Yes you can call MDIContainer function from child form. ... instance for MDI form for any number of call and through that shared Property ... > Basically I have an function in the main MDIContainer form which opens child ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Wiring up events in a less-messy way
    ... "AddHandler Hell". ... have my main MDI form and some child forms enable and disable some buttons ... that the main form and child forms can respond to it ... allow my UserAuthentication class to raise AppEvents's "LoginStateChanged" ...
    (microsoft.public.dotnet.framework.windowsforms)