J
JT
Hi,
I have designed my object hierarchy in the following way and I'm just
wondering if there is a better way to do this because I've encoutered a
blocker when it comes to disposing.
I have a generic class A which takes some parameters at construction.
I have static classes B & C each of which creates an instance of A and pass
in different parameters.
A is internal and sealed.
B & C are public and used by clients of my framework.
My problem is that I need to dispose of the instance of A inside B & C
because it creates some disposable objects. However since B & C are static I
can't implement IDisposable.
Have I designed my objects incorrectly or is there a solution for this. It
should be noted that B & C are long lived objects and will only be disposed
of when the application shuts down.
Thanks in advance for any suggestions.
I have designed my object hierarchy in the following way and I'm just
wondering if there is a better way to do this because I've encoutered a
blocker when it comes to disposing.
I have a generic class A which takes some parameters at construction.
I have static classes B & C each of which creates an instance of A and pass
in different parameters.
A is internal and sealed.
B & C are public and used by clients of my framework.
My problem is that I need to dispose of the instance of A inside B & C
because it creates some disposable objects. However since B & C are static I
can't implement IDisposable.
Have I designed my objects incorrectly or is there a solution for this. It
should be noted that B & C are long lived objects and will only be disposed
of when the application shuts down.
Thanks in advance for any suggestions.