I've written a couple of c# forms applications which use a lot of the same data/objects which would better be combined. I realise I could use modal forms to launch each of these but where should I state .dll's and other resources, on the parent form? or on each other form where necessary?
+1
A:
The things you can use:
- static objects;
- singleton pattern;
- pass objects in forms constructors or properties;
- use inherited forms, keeping in the base all common properties.
serhio
2010-04-27 14:30:19
A pattern is not a thing.
MusiGenesis
2010-04-27 14:44:37
To show a thing, you show the thing. To show a pattern, you show a bunch of other things because you *can't* show the pattern itself. Therefore a pattern is not a thing in the same sense that a thing is a thing.
MusiGenesis
2010-04-27 17:48:33
This would make total sense in French. :)
MusiGenesis
2010-04-27 17:48:56
a thing is not imperatively material.
serhio
2010-04-27 18:38:36
But a pattern *is* imperatively non-material, yes?
MusiGenesis
2010-04-27 20:05:01
What I say that a thing could be immaterial, so a pattern.
serhio
2010-04-28 08:43:56
I will remove my comments, any sense .
serhio
2010-04-28 12:42:22
A:
A quick solution may seem like using singleton/static objects; but it may cause trouble in case you have multiple users accessing your business objects.
The other thing that you can do is that you add your objects in Master Form, and call master form objects from child forms.
Just as a side note, you can also think about a 3 tier approach:
- The data layer, if any that you have.
- Your business objects; the business logic layer.
- The presentation layer;
Access your BLL via your presentation and change whatever, wherever(which Form), and however(defined in your BLL). Use data layer to manipulate your business.
KMan
2010-04-27 14:42:15