• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Subclass final class (Boolean) ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclass final class (Boolean) ?


  • Subject: Re: Subclass final class (Boolean) ?
  • From: Ken Anderson <email@hidden>
  • Date: Wed, 30 Aug 2006 08:11:51 -0400

There are hundreds of reasons to extend String.  Maybe you want strings to be able to archive in a special way?  Maybe you need them to be initialized from a special type?

Yes, in those cases, you could use a static helper function.  Inelegant, but functional.

More importantly, there are often times when the instance implementation and the static class methods must be implemented in the same class.  This is the case that I had that originally started this thread.  The problem was, an existing tool took 3 parameters:

1)  The class name of the instance you want to use to represent something in a database
2)  The method ON THAT CLASS that generates the representation you want for the database storage
3)  The static method ON THAT CLASS that can be used to initialize a new instance from database storage

There is no way to make this work without subclassing - and that is why I don't like 'final'.

Everyone - please - there are language capabilities that are good and bad depending on how you use them.  There are functions people may not understand or need, while others might.  I was complaining about 'final' in the midst of trying to accomplish something, not to start a debate.

Ken

On Aug 30, 2006, at 3:57 AM, Marcin Lukasiak wrote:

I'm saying about your design - you can always use composition instead of

inheritance in your design, when class is marked as final.

Still I don't see resonable case when I would like to extend String

especially because it is immutable so what is the real need that you would

like to extend it?


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >RE: Subclass final class (Boolean) ? (From: "Marcin Lukasiak" <email@hidden>)

  • Prev by Date: Problem with NSTimestamp
  • Next by Date: Re: Problem with NSTimestamp
  • Previous by thread: RE: Subclass final class (Boolean) ?
  • Next by thread: Re: Subclass final class (Boolean) ?
  • Index(es):
    • Date
    • Thread