You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Iordanov, Borislav (GIC)" <bo...@miamidade.gov> on 2006/12/08 18:47:37 UTC

singleton validators and converters

Hi,

 

Is there a standard way/practice to have singleton validators and
converters? Those are mostly stateless and in a large application with
aggressive input validation, it would make sense to avoid creating them
on the fly each time and for each user.

 

Thanks,

Bolerio


Re: singleton validators and converters

Posted by Craig McClanahan <cr...@apache.org>.
On 12/8/06, Iordanov, Borislav (GIC) <bo...@miamidade.gov> wrote:
>
>  No problem with concurrency, as I said they have no state. A lot of
> patterns would make sense, but JSF API/taglib doesn't seem to facilitate any
> of them, hence my question.
>

Object creation and GC overhead was a very significant issue in early JVMs
(10, 1.1), and has gotten to be progressively less or an issue in later
versions as algorithms have improved.  This has gotten to the point that
with 1.3/1.4 JVMs, we started to see benchmarks where the overhead of
maintaining a pool exceeded the overhead of allocating and GCing new objects
every time, for a significant number of use cases (but especially in simple
lightweight classes).  Thus, you see the more modern APIs not implementing
pooling and factories -- for example, in JSP the historical tag classes were
pooled, but SimpleTag instances are not.  JSF's architecture follows this
modern trend.

Best,
>
> Bolerio
>

Craig

RE: singleton validators and converters

Posted by "Iordanov, Borislav (GIC)" <bo...@miamidade.gov>.
No problem with concurrency, as I said they have no state. A lot of
patterns would make sense, but JSF API/taglib doesn't seem to facilitate
any of them, hence my question.

 

Best,

Bolerio

 

________________________________

From: Julian Ray [mailto:julianjray@yahoo.com] 
Sent: Friday, December 08, 2006 1:00 PM
To: 'MyFaces Discussion'
Subject: RE: singleton validators and converters

 

Wouldn't singletons need to be multi-threaded otherwise you will get
probems with concurrency. Would a pooled resource pattern make more
sense if you validators/converters are costly to create?

 

 

________________________________

From: Iordanov, Borislav (GIC) [mailto:boris@miamidade.gov] 
Sent: Friday, December 08, 2006 12:48 PM
To: MyFaces Discussion
Subject: singleton validators and converters

Hi,

 

Is there a standard way/practice to have singleton validators and
converters? Those are mostly stateless and in a large application with
aggressive input validation, it would make sense to avoid creating them
on the fly each time and for each user.

 

Thanks,

Bolerio


RE: singleton validators and converters

Posted by Julian Ray <ju...@yahoo.com>.
Wouldn't singletons need to be multi-threaded otherwise you will get probems
with concurrency. Would a pooled resource pattern make more sense if you
validators/converters are costly to create?
 

  _____  

From: Iordanov, Borislav (GIC) [mailto:boris@miamidade.gov] 
Sent: Friday, December 08, 2006 12:48 PM
To: MyFaces Discussion
Subject: singleton validators and converters



Hi,

 

Is there a standard way/practice to have singleton validators and
converters? Those are mostly stateless and in a large application with
aggressive input validation, it would make sense to avoid creating them on
the fly each time and for each user.

 

Thanks,

Bolerio