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@not.for.spam> wrote in message
news:%23QV$AU7DGHA.3984@TK2MSFTNGP14.phx.gbl...
| "Marcel Hug" <marcel.DOT.c.DOT.hug@ATch.abb.com> a écrit dans le message
de
| news:
eBlJyC6DGHA.2956@TK2MSFTNGP14.phx.gbl...
|
|| 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
|
|