Hi NG !
I have already written a task about MVC and I tried to get the best
informations together.
I would like to implement the MVC pattern and it work on the way I did it.
At first i know the MVC-ipmlementation from the JAVA by using the
observer-pattern.
I used an interface IObservable (AddObserver, RemoveObserver,...). My Model
implemented this interface.
I created a second interface IObserver (Update(Iobservable)).
I have to datagrids, which have to show the content of correpsoning datasets
in my model, which would be updated by user interactions.
So i created 2 classes (one for each grid), which extends from DataGrid and
implements IObserver.
In my dump mainForm i designed my to datagrids.
In the constructor i used the following code:
IObservable myModel = new SupportMaintainer();
myModel.AddObserver((IObserver) this.dataGridFailures);
myModel.AddObserver((IObserver) this.dataGridMessages);
Now my questions:
1.) In order to run the program i have initialized my designed datagrid with
my two classes (which extends) from datagrid.
It works good, but I have done this initializing in the InitialieComponent()
Methode, which should not be edited in the editor (summery-remark). Is it a
"illegal" way to do this, like i did ? Why should this code not be edited ?.
Would it be better to create UserControls for my datagrid classes
(Observers) ?
2.) Is there a possability to use my classes in the form without creating
usercontrol. I guess not by using the designer !?!
Thanks and regards
Marcel