I think, anyway, that you shouldn't even need to force them to do the
dispose. You can just do it, in some base class upwards, no, in the
implementation of GetPrices?
I agree with this too.
On the subject of Forcing the programmer to do something - I don't think this
is possible...you just have to make it as obvious as possible that it needs to
be Disposed (as mentioned b4 by providing an Open( ) or similar) and then have
adequate documentation.
The same issue exists for database connections (the need to Close) where the
onus is left on the programmer. (hire good programmers!)
Wal
On 25/01/2011 6:49 AM, Noon Silk wrote:
On Mon, Jan 24, 2011 at 11:38 PM, David Rhys Jones<[email protected]> wrote:
Hi all,
Background:
I've got a service connection that is limited to 5 logins, (internal app
written in another dept, Java Webservice not WCF compatible.), I've
implemented a library (C# 3.5) that calls this and a number of different
services to provide a coherent data source for our Excel (2003)
applications.
In my dispose, I clean everything up correctly, connections are closed,
webservice is disposed etc.
Problem:
I need to find a way to force the developpers in my team and in the other
teams that use my library to call the Dispose method after each use of the
library.
Yeah, I tend to agree with Michael, I think your design is slightly
wrong. It doesn't look correct to be disposing a member variable.
(What happens if it is re-called?) I don't know if this is a function
of Spring.Net though; I've never used it.
I think, anyway, that you shouldn't even need to force them to do the
dispose. You can just do it, in some base class upwards, no, in the
implementation of GetPrices?
thanks
Davy,
"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding
--
Wallace Turner | General Manager IT
FEX | 61 2 8024 5200 61 2 8024 5234 | | [email protected]
www.fex.com.au
This correspondence is for the named person's use only. It may contain
confidential or legally privileged information or both.
No confidentiality or privilege is waived or lost by any mistransmission. If
you receive this correspondence in error, please
immediately delete it from your system and notify the sender. You must not
disclose, copy or rely on any part of this
correspondence if you are not the intended recipient.