Re: To wrap or not to wrap?



Aaron Fude wrote:
In my personal development efforts, I frequently wrap basic java
functionality. For example, I have a

String MyIO.urlToString(String url)

or

byte[] MIO.urlToBytes(String url)

etc. These functions catch exceptions and return null if something
goes wrong. I have other functoins that, for example, load database
queries into maps.

My gereneral questions are these. Does everybody pretty much end up
writing convenience wrappers like these for themselves?. If yes, why
aren't utilities like these commonly available as more or less
standard libraries? And if no - why not? Is it a bad idea to use these
and is it for some reason better to, e.g., always form URL's, open
connections, capture exceptions, etc.

I think it is a bad idea.

You should use the exception functionality as it is intended.

Arne
.



Relevant Pages

  • Re: which kind of Exceptions to throw?
    ... As far as the distinction between the two go, ... generally considered to be that NotSupportedExcpetion is used in derived ... classes where the functionality isn't built into the base class. ... I'd recommend using custom exceptions when you need finely grained ...
    (microsoft.public.dotnet.general)
  • Re: To wrap or not to wrap?
    ... functionality. ... String MyIO.urlToString ... These functions catch exceptions and return null if something ... to the corresponding chemistry table where I had a friend. ...
    (comp.lang.java.programmer)
  • Re: Exception handling and logging.
    ... > I am creating a .NET library with functionality that I am giving to ... This other developer does not want to be bother ... with exceptions because he really has no choice. ... > He want however me to log all exception to a common logging system. ...
    (microsoft.public.dotnet.framework)
  • Re: How to find unused methods?
    ... functionality. ... This will also show you unused variables and exceptions. ... I actually have a license and it's installed in my VS2005 instance, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: why use the sealed ?
    ... > I'll want to add functionality to something at a later date. ... > I sortof wish you could add functionality to (or replace members of) ... > exceeds past the end of the string. ... > application to be a Remoting Client. ...
    (microsoft.public.dotnet.languages.csharp)