P
panik
Hi,
I'm busy building a small windows application, and as I'm fairly new to OOP
programming (have worked about 2 years with C# now), I would like some
advice.
I have two windows forms that share a few sets of functionality. I'll
explain:
Form A has a list of Clients. Each Client has a list of Projects as children
(displayed in a TreeView). This form has a few functionalities for the
Clients like: NewClient and DeleteClient.
Form B has also a list of Clients. Each Client has a list Databases as
children (displayed in a TreeView). Here too, the form makes it possible to
add a Client, or remove one.
I was wondering how I can have both forms share the same functionality.
Right now I created a Utility Class, called Handling, that has a few Methods
(NewClient, DeleteClient) so in my Mouse or KeyDown EventHandlers of *both*
forms, I can call Handling.NewClient();
Is this a correct way of doing it? Or should I better instantiate a Client
Class? I wanted to avoid to create a new object, as the only thing that
happens when adding a Client is adding a record to a database and a node to
the TreeView.
Thank you for the advice.
Vincent
I'm busy building a small windows application, and as I'm fairly new to OOP
programming (have worked about 2 years with C# now), I would like some
advice.
I have two windows forms that share a few sets of functionality. I'll
explain:
Form A has a list of Clients. Each Client has a list of Projects as children
(displayed in a TreeView). This form has a few functionalities for the
Clients like: NewClient and DeleteClient.
Form B has also a list of Clients. Each Client has a list Databases as
children (displayed in a TreeView). Here too, the form makes it possible to
add a Client, or remove one.
I was wondering how I can have both forms share the same functionality.
Right now I created a Utility Class, called Handling, that has a few Methods
(NewClient, DeleteClient) so in my Mouse or KeyDown EventHandlers of *both*
forms, I can call Handling.NewClient();
Is this a correct way of doing it? Or should I better instantiate a Client
Class? I wanted to avoid to create a new object, as the only thing that
happens when adding a Client is adding a record to a database and a node to
the TreeView.
Thank you for the advice.
Vincent