-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Partial validation: groups explained
PostPosted: Thu Apr 10, 2008 9:56 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Check this blog entry

_________________
Emmanuel


Top
 Profile  
 
 Post subject: XML Deployment descriptor
PostPosted: Wed Apr 23, 2008 7:39 pm 
Newbie

Joined: Wed Apr 23, 2008 5:29 pm
Posts: 2
Thanks for this nice JSR!
If you guys managed to work on the initial draft of the XML Deployment as well, please do post a preview.

thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 8:48 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The XML will be mainly a transposition of the annotations model. That's why we left it for the end.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: No: of Constraint Implemn per constraint in an application
PostPosted: Wed Apr 23, 2008 9:39 pm 
Newbie

Joined: Wed Apr 23, 2008 5:29 pm
Posts: 2
We have a propreitory web framework and we are strictly prohibited from creating too many objects (extremely high volume site ) and hence this question -

public interface Constraint<A extends Annotation> {
void initialize(A constraintAnnotation);
boolean isValid(Object value);
}

I'm a little confused with this interface. I wanted to check if i can work with a singleton instance of an implementation for a given constraint?

I understand that isValid() will be called everytime validation kicks in. What about initialize()?

I mean does it make sense to have

boolean isValid(Object value,A constraintAnnotation); ?

Your response would be very helpful when i talk to my web architect about relevance of jsr303 to our propreitory web framework.

thanks,
Karthik


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 11:26 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You are the second person asking for that http://forum.hibernate.org/viewtopic.php?t=985983

For each constraint impl, initialize is called once (slightly after instantiation).

Usually one constraint impl object is instantiated per annotation. The number of constraint is fairly limited, let's say 2000 on a 300 entity model.

In the example of @Max, I imagine the instance would take around 100 bytes in memory, so we are talking about 200k of memory for 2000 constraints. Is it really useful to use a singleton approach?

That being said, the constraint is build by a ConstraintFactory, I imagine it's possible to tweak a ConstraintFactory to create singletons. But at that point I think you would use more CPU and have more scalability headaches than what 200k of memory is worth.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.