Re: MVC-Pattern in my C# GUI !?!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Joanna,
|| For learning work with patterns I would like to add the MVC-Pattern in my
|| little application.
|
| May I advise that you can't "add" MVC in an application, you really need
to
| design the application to use the MVC framework; but that may just be a
| difference in how we say the same thing :-)
I agree.

However! Using Refactoring & Refactoring To Patterns, surely one can *add*
the MVC pattern to an existing app that currently doesn't use the MVC
pattern?

http://www.refactoring.com/
http://www.industriallogic.com/xp/refactoring/

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net


"Joanna Carter [TeamB]" <joanna@xxxxxxxxxxxx> wrote in message
news:%23QV$AU7DGHA.3984@xxxxxxxxxxxxxxxxxxxxxxx
| "Marcel Hug" <marcel.DOT.c.DOT.hug@xxxxxxxxxxxx> a écrit dans le message
de
| news: eBlJyC6DGHA.2956@xxxxxxxxxxxxxxxxxxxxxxx
|
|| For learning work with patterns I would like to add the MVC-Pattern in my
|| little application.
|
| May I advise that you can't "add" MVC in an application, you really need
to
| design the application to use the MVC framework; but that may just be a
| difference in how we say the same thing :-)
|
|| On my form (View) I have a TabController with 2 tabs. In each tab I would
|| like to have a datagrid, which should be updated after some changes. So
| this
|| two datagrids must implement my observer-interface. My class
| supportControl
|| would be the Model, which extends from my observable class.
|
| You should not have anything other than visual controls on your forms, the
| Controllers should be separate classes, instantiated in code outside of
the
| form.
|
| You will also need to provide a set of wrapper classes that will allow you
| to detect when you set the properties of your business classes, so that
the
| Controller can handle things like an Changing, or Changed event fired from
| the "property".
|
| As to the visual components on the form, if you want to avoid deriving
from
| the existing controls to implement the Observer pattern, these also need
to
| have wrapper classes that implement the Observer pattern and carry out the
| Update method against the enclosed UI control.
|
| You could also just use the data-aware nature of the existing controls to
| replace teh Observer pattern, but write a Controller that catches the
| Validating event of the controls so that you can enforce business rules
when
| leaving an edit control.
|
| IMO, MVC is fairly well implemented, although not obviously, in the new
..NET
| data-aware controls.
|
| I have written a series of articles on MVP (a sort of super MVC) on my
| website www.carterconsulting.org.uk
|
| Joanna
|
| --
| Joanna Carter [TeamB]
| Consultant Software Engineer
|
|


.



Relevant Pages

  • Re: GUI enabling/disabling design pattern
    ... Straightforward implementation of Observer pattern requires that Observers ... changes (those things in the question which state affects GUI controls). ... Or Subjects would need to know about some common interface from GUI Widget ... To avoid that there will be needed some kind of mediator class (Mediator ...
    (comp.object)
  • Re: OODesign approach in reality
    ... but as far as I know any standard UI component ... No DA controls are needed. ... pattern. ... descendant gui components. ...
    (borland.public.delphi.non-technical)
  • Re: MVC-Pattern in my C# GUI !?!
    ... May I advise that you can't "add" MVC in an application, ... You should not have anything other than visual controls on your forms, ... the existing controls to implement the Observer pattern, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Another Lesson
    ... of my lessons I was in the downwind leg in the pattern and the right ... have fairly light controls. ... you can turn some gloomy weather into a lot of ... it is possible it was wake turbulence. ...
    (rec.aviation.student)
  • Re: Big scare story
    ... normally flew during the week but this was a Saturday and the pattern ... was full of airplanes. ... controls. ... before I could land. ...
    (rec.aviation.piloting)