-->
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.  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next

Using FreeMarker instead of Velocity
Yes, lets get sensible error messages 50%  50%  [ 2 ]
No, I am addicted to spend hours of leading-no-where debugging 25%  25%  [ 1 ]
I don't care 25%  25%  [ 1 ]
I have an alternative suggestion (place a comment) 0%  0%  [ 0 ]
Total votes : 4
Author Message
 Post subject: FreeMarker instead of Velocity
PostPosted: Wed Jan 25, 2006 10:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I'm preparing for an upcoming release of the tools and is starting to get more and more annoyed with the "hacks" and voodoo I have to apply to make Velocity barely usable.

I even tried upgrading to velocity 1.5-nightlybuild which should solve some of these issues (especially with respect to error handling), but it turns out that they depend on commons-collections 3 which is not very compatible with commons-collections 2...so no dice for that.

So, I would like to hear what you guys would say if we decided to use FreeMarker instead of Velocity ?

This will not affect "normal" usage, only those who are writing their own custom templates and for that FreeMarker has a velocity to freemarker syntax converter (have not tested it yet though)

_________________
Max
Don't forget to rate


Last edited by max on Wed Feb 01, 2006 8:52 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 2:33 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
I think this sounds like a lot of work. I have had problems w/ velocity as well, but perhaps an even stronger test suite for hibernate tools would be a better waste of time.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 3:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh - what is missing from the testsuite ? There are more almost as much tests as there are code!

I even have unittests that run through the complete code generation process and compiles the code to verify the output is syntactically correct and that it can actually *run*. If i did not have this I would not have any progress at all ;)

It is the fact that just writing a unittests against velocity to see if it fails in different scenarios is impossible since velocity just ignores stuff that I don't want it to ignore.

And my local unittests does not help users when they start extending their own templates and/or bump into some missing corner.

What kind of "stronger tests" are you thinking off ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 3:58 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
p.s. and yes it would be a bit of work, but *because* of the unit tests I don't see it as something I couldn't do in a day or two (including deciding not to do it because i bump into weird freemarker issues ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:16 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
"even stronger" means it is already strong, so don't get so defensive please. The tools rock ;)

I have however come across a few cases where I was getting invalid and/or non-well-formed XML.

http://opensource2.atlassian.com/projec ... se/HBX-420
http://opensource2.atlassian.com/projec ... se/HBX-406

Perhaps you could be asking for something else from the hibernate community. With this many users, I'm sure you could get a dozen decent sized domain models / data models as contributions to the test suite. There would be plenty in it for organizations that could do this. I think this could make HT "even stronger" and it would cost less money.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
none taken ;)

The cases you point at is things that at the time were "not-yet-implemented" features which is hard to guard against in nature.

What i need there is that users give more feedback (like you have done) so i can ensure that we either get the feature in there OR make the tools complain about it.

And this last part here is really cumbersome to do when using Velocity since it simply tries to ignore too much - so when you apply the tools in an area where the features are not complete it does not complain even though it could.

And regarding models from users then I have asked publically in here and on the dev list more than once and have not yet received any models or contributions. I did get some mails (1 or 2) saying that they would like to contribute but 1: did not have the time or 2: could not provide it because of company policy.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:51 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
well, if Tools goes to freemarker, I won't be switching back to middelgen. I'm just not looking forward to it.

as for free data models, your saying JBoss doesn't have at least one database w/ 70 or so tables?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 4:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Quote:
well, if Tools goes to freemarker, I won't be switching back to middelgen. I'm just not looking forward to it.


I don't really understand this sentence ;) First part sounds positive, second part negative. Any objections against FreeMarker ? Remember i'm just suggesting this one since my initial readings and test shows a much more precise error reporting and flexibility where i currently need it.

And regarding getting tables, then that is not the problem - I can create those scenarios by hand. And getting one "clean" model with N tables does not help since such systems normally just do the same thing again and again... I need diversity and *mapping* files.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:09 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
I'm saying that I'd rather keep Velocity because I am getting more than my fair share of new java frameworks/tool kits these days. That being said, if I had to pick up another one, I wouldn't stop using tools (because this is not exactly a huge learning curve).

How big is the datamodel for bugzilla ? or what about any one of those crappy free PHP products that seem to be everywhere ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hehe - so you would rather stay with velocity and get weird error messages which is the direct cause of a flood of questions on the forums than try and use something more userfriendly ?

Regarding using bugzilla and other db models I have thought about it and might do it for some hand based testing (since they all require a specific db) - but again, I would rather have hbm.xml and corresponding java code to work from ...its here the test really is.

Getting various db schemes will just test the reveng code which is better off with isolated testcases.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:18 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
also, how do we actually vote for this?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:19 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you can't vote ? should just be to click on the choice you want ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:23 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
max wrote:
(since they all require a specific db) - but again, I would rather have hbm.xml and corresponding java code to work from ...its here the test really is.


Gee, if only there was some great project in java land that allowed one to probe a different databases, generate ORM meta data and java that was db neutral ;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:25 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
I clicked all over that grey thing at the top and nothing happens.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 5:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you do know that the reveng facility is only about 15% of the toolset, right ? :)

The rest is generation from the hibernate meta model and the reveng will/can only utilize a very specific subset of this model - and this specific subset is covered in the tests ;)

The other part is the "weird" mappings people do that cannot be deduced from jdbc metadata only and thus human written mapping files is wanted.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 64 posts ]  Go to page 1, 2, 3, 4, 5  Next

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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.