• 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: SimpleDateFormat vs [Deprecated] NSTimestampFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SimpleDateFormat vs [Deprecated] NSTimestampFormatter


  • Subject: Re: SimpleDateFormat vs [Deprecated] NSTimestampFormatter
  • From: David Holt <email@hidden>
  • Date: Mon, 9 Mar 2009 11:28:07 -0700


On 9-Jul-08, at 10:42 AM, Kieran Kelleher wrote:


Wonder: ERXTimestampFormatter.dateFormatterForPattern( pattern )

I am moving my code away from using date format strings in the format bindings in my .wod and looking up old email threads about the deprecation of NSTimestampFormatter. This class suggested by Kieran returns an NSTimestampFormatter. Can I safely continue to use NSTimestampFormatter for now or am I missing a WOnder alternative that uses Pierre's recommendation of SimpleDateFormat?


David




......... app-level caching built-in.

On Jul 9, 2008, at 12:43 PM, Chuck Hill wrote:


On Jul 9, 2008, at 7:56 AM, Ken Anderson wrote:

umm...  pretty much all of it.

If you're allocating all the objects you deal with inside your components, you probably aren't faced with many issues, but any time you start considering anything that is shared, you have to consider the fact that java is natively multi-threaded, and there are always other threads running, even if you're not concurrently handling requests.

True that.


For instance, if you always instantiate a formatter inside your component and that thread is the only one that know about it, you should be fine. However, if you're sharing an instance (usually for performance reasons), you need to be aware of the fact that it could be called from multiple places at the same time.

Looking at them both, as long as you are not changing the format pattern, time zone, etc. and _only_ using them for formatting, they should be re-entrant. I would not swear to it thought. I have never had a problem using NSTimestampFormatter like this (cached at app level, shared across all threads).



Chuck



On Jul 9, 2008, at 10:18 AM, Gennady Kushnir wrote:

Hmm...
I'm not quite shure in what parts of WO programming it is vital to be
thread safe?


2008/7/9 Ken Anderson <email@hidden>:
I'm sure Pierre could answer this better than anyone else, but I always lock
NSTimestampFormatter when used in multi-threaded situations...


On Jul 8, 2008, at 7:03 PM, Chuck Hill wrote:

Also note that unlike NSTimestampFormatter, SimpleDateFormat is not thread
safe. At least NSTimestampFormatter is not documented to be non-thread
safe.



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


This email sent to email@hidden


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






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


This email sent to email@hidden

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


This email sent to email@hidden

_______________________________________________ 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
  • Follow-Ups:
    • Re: SimpleDateFormat vs [Deprecated] NSTimestampFormatter
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Finding eomodels in Eclipse/WOLips
  • Next by Date: Re: ant build problem
  • Previous by thread: Re: directActionURLForActionNamed produce corrupted hostname
  • Next by thread: Re: SimpleDateFormat vs [Deprecated] NSTimestampFormatter
  • Index(es):
    • Date
    • Thread