greptilian logo

IRC log for #javaee, 2013-08-11

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:20 SoniEx2|2 joined ##javaee
01:41 crimsonfubot joined ##javaee
03:28 SoniEx2|2 joined ##javaee
03:52 SoniEx2 joined ##javaee
04:29 Naros joined ##javaee
04:29 Naros sfisque: you here?
04:35 * SoniEx2 hugs sfisque and goes to bed
04:50 SoniEx2|2 joined ##javaee
05:51 SoniEx2|2 joined ##javaee
07:59 syncsys_ Naros,  hi.
08:50 SoniEx2|2 joined ##javaee
09:51 SoniEx2|2 joined ##javaee
12:08 Quest joined ##javaee
12:28 syncsys_ joined ##javaee
12:35 syncsys_ joined ##javaee
12:46 syncsys_ joined ##javaee
12:50 SoniEx2|2 joined ##javaee
13:19 syncsys_ joined ##javaee
13:25 syncsys_ joined ##javaee
16:10 Naros hi Quest
16:15 Naros I'm wondering if there is anyway that when using @EntityListeners that if multiple entities use the same Listener class, is there anyway for those to share the same class instance rather than creating a new instance for every @EntityListener annotation.
16:48 Naros or am I just worried about negligible overhead for several thousand entity classes?
16:51 SoniEx2 joined ##javaee
17:07 Quest Naros,  you have a point
17:08 Naros It isn't every entity that uses these listeners but a great deal of them do and to have multiple instances being allocated for the same small piece of callback seems silly
17:09 Quest yes. agreed
17:09 Naros I thought about using Hibernate's Event system but the issue here is that the event system doesn't fire a pre-insert until post entity validation
17:09 Quest hm
17:10 Naros the crux of the issue is I have a number of entities with an embeddable property.
17:10 Naros What I didn't want to do is have to new this embeddable on new entities.
17:11 Naros But if I define the embeddable like this
17:11 Naros private AuditColumns auditColumns = new AuditColumns();
17:11 Naros then during the load part of the entity, that's an unnecessary allocation.
17:11 Naros because it seems Hibernate allocates it's own AuditColumns(), populates it and then calls setAuditColumns() with it
17:12 Quest hm
17:13 Naros the only solution I have found has been either in the getAuditColumns(), add a check for null, and allocate if it is null or use JPA EventListeners on @PreInsert to manipulate the entity with a new AuditColumns().
17:13 Quest you are right. but I cant say much as I dont have that much indepth research
17:13 Naros Unfortunately I can't refactor a lot of this because many entities have both an AuditColumns and DisabledColumns embeddable, some just a DisabledColumns and some with just Audits
17:13 Quest I would go for the later one, JPA evenlistteneres
17:14 Quest Naros,  have you tried stackoverflow.com  to ask?
17:14 Naros Not yet, I've been doing a fair amount of google search to see if I could find some best practices
17:14 Naros Our old implementation did a fair amount of private variable news
17:15 Quest when you finish. that. i suggest a stack post and a link to me too
17:15 Naros The issue I have with that is how much stress would that put on the GC when loading entities from the DB.
17:16 Naros since hibernate allocates it's own embeddable instance and calls set
17:16 Quest sfisque,  and whartung  are quite experienced here. may be they can comment too.
17:16 Naros aye, suspect with weekend - they are out and about.
17:16 Quest Naros,  hm. a nice elaborated stack post would help a lot
17:17 Quest Naros,  yes. weekend. and we are having some festival in our place too. so all are busy that i can invite either
17:18 Quest Naros,  by the way. what do you use to communicate back and forth or with ajax. json or xml?
17:19 Naros when you say back and forth, do you mean dynamically on web pages?
17:19 Naros We typically use AJAX in combination with JSON.
17:20 Naros We only use XML when streaming data from Hibernate to Apache FOP
17:21 Naros to create PDF outputs
17:21 Quest Mmm to be little more exact.
17:22 Quest its a javaee question but its more of a strategy question rather a php/javaee
17:22 Quest I need to update the changed elements of a page every 10 seconds by ajax. I populate the elements in the first place on page load is by send an object to jsp. the iterating like wise. the object  are  e.g a board which have many boxes, and each box may have many tasts. tasks then have child nodes like text and title.  Now 1. how do I interchange/pass the data from ajax call and page. 2. how to see/compare for changes and reflect only the changed nodes/ ob
17:22 Quest jects?
17:23 Naros well I'd suggest you also consider jquery in this mix.
17:23 Quest but I think its not a question of updating by ajax. or not.  its about choosing a generic and easy thing. I know json occupies less data and xml is more taggy. but thats it?
17:23 Naros because then you can serialize a form's parameter list and pass it with your ajax callback.
17:23 Quest I would use jQuery obviously
17:23 Naros er that doh lol
17:24 Naros you tell ajax that the data you're getting back is json
17:24 Quest I always had confusion with what serialization is.  its just used to transfer data
17:24 Naros then the success handler basically has a json object
17:24 Quest Naros,  ya but why json?
17:24 Quest why not xml
17:24 Naros Well JSON objects can be iterated like java objects in Javascript.
17:25 Quest xml object can be too
17:25 Naros I suppose if you have a way to interpret XML in Javascript, you could do that too
17:25 Quest hm
17:25 Naros but JSON objects are generally lower bandwidth
17:25 Quest a bit yes
17:26 Quest but thats it i think.
17:26 Naros http://stackoverflow.com/questions/325085/when-to-prefer-json-over-xml
17:27 Naros seems json data can be parsed/validated in browsers easier and faster than XML
17:27 Quest hm
17:27 Naros but another post follows in that thread saying XML+XSL is more efficient for larger data sets
17:32 pdurbin "FtanML is a notation for data and documents designed to combine the simplicity of JSON with the expressive power of XML" -- http://dev.saxonica.com/blog/mike/2012/08/ via http://programming.oreilly.com/2013/08/can-we-do-better-than-xml-and-json.html and https://plus.google.com/107770072576338242009/posts/SW6riihYxTq
17:35 Quest_ joined ##javaee
17:35 Quest_ hm. thanks
17:37 Quest hm. thanks
18:47 SoniEx2|2 joined ##javaee
21:00 sfisque joined ##javaee
21:26 kobain joined ##javaee
21:46 SoniEx2|2 joined ##javaee
22:47 SoniEx2|2 joined ##javaee

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.