Finished! (more or less) So yes you can build a really big complex app on Activeweb

50 views
Skip to first unread message

Gianna Giavelli

unread,
May 22, 2015, 6:02:16 AM5/22/15
to acti...@googlegroups.com

OK I basically finished my app today and while theres still bits and pieces, I thought I'd take a minute and review my experience. 

One of my main issues is that I probably didn't read all the documentation TWICE and review the kitchen sink very carefully before starting. In my defense, much of this wasn't done a year ago when I started. 

I think I have gone from acolyte to well perhaps not activeweb jedi master but close. I can now do really complex pages that automatically yank in sub pages, partials, have mutlliple forms or linktos calling post functions and post arguments feeding into jquery page actions that modify or insert data and then make a new post call to update data based on a css style set somewhere in the page. WHEW! 

My sense of the framework is that it's coming together. I'll have to do some load testing on it but I'll wait until I cloud load it. 

for those who care, my env is:
   dev in windows (YUK!)
   eclipse luna
   tomcat 7.1
   mysql (latest) cluster
   5 year old lenovo pentium with 2gb ram that seizes up constantly

And my app is:
  about 50 really complex tables and about 50 different .ftls,  10 shared bits I dynamically load and about 8 partials.   I only have a few controllers but a lot ended up in Main so that can be broken out a bit. 

It is so fast on my tiny computer that I haven't even turned on caching yet. Once you get to the second time a page is loaded tis quite blazing. So I assume theres a freemarker compile at first go.

My click to test time is much nicer than j2e was. and my errors are quicker to jump on and figure out than j2e. which for me is the biggie. 

So far, I dont have a ton of validation and if I do go the route of specifying out all the validation in the model it might be close to the amount of work of a pojo in j2e. Even still, the zip off the line to start prototyping is much faster. 

I didn't really ever get the layouts stuff. I just bypassed it. I'll have to look again but I just never used it. 

I do wonder about optimization and performance when I get to using findBySql but I assume its a prepared statement essentially. 

I thought the _ID stuff to bring in child models for one to many was really great. I loved autofill of created_at and updated_at, would love it to add the created_by and updated_by as per my prior comment but we can do we can do ourselves. 

I will have to deal with translation and seeeeems like will be ok, but we will see. 

I will give J2E the nod for transactionality but it's not enough to make me want to go back unless I'm doing a banking app!

I would suggest having the docs for how to extend the language up so that we can do cool things and starting building our own beasties to share. 

I also found that maintaining query params as I forwarded to this to forward to that to forward to that could have used some built in language support. 

for all my dumb or layperson questions, I thank your patience. Its really cool to see everything running finally after a lot of long nights. 

best regards to Igor I thank you for all your hard work on this. OK it's 5am and if I hurry I can finish before the kids start yellin

Gia

Josh Kamau

unread,
May 22, 2015, 6:44:06 AM5/22/15
to acti...@googlegroups.com
Thanks for sharing.  I am just getting started . 
ActiveWeb is in my opinion the best java web framework out there... yet it receives very little publicity. 

Josh

--
--
You received this message because you are subscribed to the Google
Groups "ActiveWeb Group" group.
To post to this group, send email to acti...@googlegroups.com
To unsubscribe from this group, send email to
activeweb+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/activeweb?hl=en?hl=en

---
You received this message because you are subscribed to the Google Groups "ActiveWeb Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to activeweb+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Igor Polevoy

unread,
May 24, 2015, 5:06:20 PM5/24/15
to acti...@googlegroups.com
Josh and Gianna, please see my comments below.


On Friday, May 22, 2015 at 5:44:06 AM UTC-5, Josh Kamau wrote:
Thanks for sharing.  I am just getting started . 
ActiveWeb is in my opinion the best java web framework out there... yet it receives very little publicity. 


Josh, I fully agree! You can write a blog article about JavaLite and submit it to Reddit and  DZone. I will help edit it for correctness. 


Josh

On Fri, May 22, 2015 at 1:02 PM, Gianna Giavelli <giannag...@gmail.com> wrote:

OK I basically finished my app today and while theres still bits and pieces, I thought I'd take a minute and review my experience. 

One of my main issues is that I probably didn't read all the documentation TWICE and review the kitchen sink very carefully before starting. In my defense, much of this wasn't done a year ago when I started. 

I think I have gone from acolyte to well perhaps not activeweb jedi master but close.

Haha, this is great. 


 
I can now do really complex pages that automatically yank in sub pages, partials, have mutlliple forms or linktos calling post functions and post arguments feeding into jquery page actions that modify or insert data and then make a new post call to update data based on a css style set somewhere in the page. WHEW! 

Excellent!  Additionally, because ActiveWeb compiles controllers on the fly you can also experiment with Java as if it were a scripting language. IN fact, sometimes I do non-web prototyping using ActiveWeb simply because I can execute some Java code without a build life-cycle:)

 

My sense of the framework is that it's coming together. I'll have to do some load testing on it but I'll wait until I cloud load it. 

It can get faster, but generally it is 3 - 4 times faster than JSF/Hbernate, and 2 - 3 times faster than Spring/Hibernate.  ActiveJDBC is 2 times faster than Hibernate. So... chances are if you did not make serious mistakes with SQL, your app will be super responsive. 



for those who care, my env is:
   dev in windows (YUK!)
   eclipse luna
   tomcat 7.1
   mysql (latest) cluster
   5 year old lenovo pentium with 2gb ram that seizes up constantly

Mine: 
Ubuntu 14
Samsung 700GB SSD (yes, no mistake here), 16GB RAM 
IntelliJ (latest)
Tomcat 7
MariaDB

 

And my app is:
  about 50 really complex tables and about 50 different .ftls,  10 shared bits I dynamically load and about 8 partials.   I only have a few controllers but a lot ended up in Main so that can be broken out a bit. 

Not a trivial app, of course. We usually use Maven to separate ActiveJDBC models into a separate "common" module, which becomes a Maven dependency for multiple web modules (publicly facing web app and internal admin web app usually)
 

It is so fast on my tiny computer that I haven't even turned on caching yet. Once you get to the second time a page is loaded tis quite blazing. So I assume theres a freemarker compile at first go.
yes, and MySQL cache, etc. You also might want to explore http://javalite.io/caching later on. 
 

My click to test time is much nicer than j2e was. and my errors are quicker to jump on and figure out than j2e. which for me is the biggie. 


Excellent. Did you write controller tests? They allow you to mimic behavior of your app in tests: http://javalite.io/testing. I think this is a single most attractive feature of ActiveWeb. No container required to test controllers!
 
So far, I dont have a ton of validation and if I do go the route of specifying out all the validation in the model it might be close to the amount of work of a pojo in j2e. Even still, the zip off the line to start prototyping is much faster. 

Agree.  

I didn't really ever get the layouts stuff. I just bypassed it. I'll have to look again but I just never used it. 


Oh... how is this possible?  Are you including menus as partials on every page? That is too much work :)  - see http://javalite.io/views#layouts


 
I do wonder about optimization and performance when I get to using findBySql but I assume its a prepared statement essentially. 

Yes, prepared. It will be as fast  as  you write it :) 

I thought the _ID stuff to bring in child models for one to many was really great. I loved autofill of created_at and updated_at, would love it to add the created_by and updated_by as per my prior comment but we can do we can do ourselves. 


yeah, I hear  you, but IMHO  created_by is more of an application feature, not the framework 
 
I will have to deal with translation and seeeeems like will be ok, but we will see. 

You can use the power of controller filters http://javalite.io/controller_filters - open transaction before a specific controller/action and commit after execution. 
This way you do not need to do this in controller (code pollution). 


I will give J2E the nod for transactionality but it's not enough to make me want to go back unless I'm doing a banking app!

I like J2EE transactions only in one case: JMS. In all other cases, I prefer to be closer to the metal. 
 

I would suggest having the docs for how to extend the language up so that we can do cool things and starting building our own beasties to share. 

Haha, sure. I was thinking of integrating a blog on the site, and have community members contribute their experiences. 

 

I also found that maintaining query params as I forwarded to this to forward to that to forward to that could have used some built in language support. 

Can you elaborate? I think there might be a better way of  doing things. 
 

for all my dumb or layperson questions, I thank your patience. Its really cool to see everything running finally after a lot of long nights. 

Oh, no problem - my pleasure!
 

best regards to Igor I thank you for all your hard work on this. OK it's 5am and if I hurry I can finish before the kids start yellin

haha, get some well deserved rest. Looking at timestamps on my comments, you can tell I work crazy hours (I live in Chicago)

Gianna Giavelli

unread,
May 28, 2015, 3:59:20 AM5/28/15
to acti...@googlegroups.com
Just to answer your questions. 

How did I get by without layouts...

My stuff is a bit complex. So I used partials instead. Also some dynamic ajax loads of page snippets. You would beat me if I showed you my layout pages. 

I also found that maintaining query params as I forwarded to this to forward to that to forward to that could have used some built in language support. 

Can you elaborate? I think there might be a better way of  doing things. 

I think what I got stuck with was the make a Ajax POST and redirect to GET pattern. I'm reading more on FLASH and how to use that to help push the params along, but then I also saw that in redirect I could pass params on when you do POST -> GET pattern. My issue is mainly I can have 20 variables I need to maintain and push between a multi part call it would be nice if somehow I could do a view on them and then make my redirect call with something like "forward_all_view_params=true" but now I see that perhaps Flash is the mechanism to do this.  Main issue is how to do this without it being a pain. I use session for the stuff that always has to fly around. One thing I thought would be cool is if you pre-pended the param name with something like "_ " and just let the framework keep it until the request is fully routed back. So once I did a view("_catalogid", value) it just recognized it and maintained it forward. at the client page its referenced just as "catalogid", but then I found that flash() could do this and also you can redirect and add the parameter to that call as well. Its a convenience issue when you have a LOT of variables. I typically have about 15. 


It is good to hear that its at least 2x the jsf/hibernate or similar.  and hibernate was already better than the earlier j2e entitites. We have to remember, databases are optimized already and prepared statements are efficient. I got stuck on so many projects doing tons and tons of stored procs for simple cases and it always made the project late, yet when I showed them perf numbers that there were no differences they refused to change. 

One thing I was thinking on, just to prevent errors and catch them at compile time, is rather than the Model.set("colname", "value") pattern it might be interesting if the model could expose as Model.setMyTitle ("val")  I usually catch these errors fast but I think with the way instrumentation works as an inject into the class something might be possible. I always prefer to catch at compile time. And that way colnames would link into the tooltip suggestion from the dev ide. just a thought. 

I dont have anything brilliant to say. It works. Its pretty good with docs that are ... brief and require a few reads. ITs all there just... you might have to really read it a few times. Its human nature to just jump in though. So like I am learning more of how FLASH was meant to be used in the POST -> GET pattern I hadn't seen that at first. (maybe it wasnt there ;*>)

OH I did have some worry when I dont have a ID column if it will impact the models and performance. e.g. my mapping join table doesn't have a ID. 

Oh one small thing. If you create a record row in the DB that has "record_version" but you leave record_version null, if you do an update it will throw an exception.  Probably this should be protected and just handle it in the framework to start with one as the value. This only happens if you create the record NOT USING ACTIVEJDBC so it's not quite a fair case, but with test data and other ways for things to create it comes up more often than one thinks. 

I will maybe try to contribute to the framework on localization support if I ever get less than very busy. 

I will add these last thoughts. I've tried MANY MANY MANY MANY frameworks. So many are here these days. This is the one that got me. None of the others lasted more than a hour. And that is due to clean design, clarity, power when needed, good encapsulation and separation of responsibilities, and you dont have to use a crappy language like ruby or generate massive amounts of pre-app-gen code just to start. you also dont have a phonebook to learn like spring. 

I not too long ago went down the microsoft .net framework on a very big project and when we started using their ORM - linq for entities in its THIRD version it was massively buggy. Yes they got it fixed in ver 5 but my trust was ruined. Yes their MVC product is probably ok, but they just dont release quality. The few problems I found in javalite were all edge cases and for the most part you could go a different way and get things to work. 

I think I will try to do a tutorial video next. I think thats probably how I can help the most.  I will work on the controller test support and other parts that I due to speed and deadlines only touched at the beginning. this is a light framework, but it can be a very DEEP framework and powerful. and that is why I like it. 

kind regards

Gia (central time zone)

Igor Polevoy

unread,
May 28, 2015, 2:33:44 PM5/28/15
to acti...@googlegroups.com


On Thursday, May 28, 2015 at 2:59:20 AM UTC-5, Gianna Giavelli wrote:
Just to answer your questions. 

How did I get by without layouts...

My stuff is a bit complex. So I used partials instead. Also some dynamic ajax loads of page snippets. You would beat me if I showed you my layout pages. 

I also found that maintaining query params as I forwarded to this to forward to that to forward to that could have used some built in language support. 

Can you elaborate? I think there might be a better way of  doing things. 

I think what I got stuck with was the make a Ajax POST and redirect to GET pattern.

Did you know that browsers do not support redirects in Ajax requests? The best way to do this is to cal Ajax and then set location in your JavaScript, forcing the browser to navigate to a different page. This way your Ajax can return JSON doc, and your JavaScript code can form a new URL with parameters
 
I'm reading more on FLASH and how to use that to help push the params along, but then I also saw that in redirect I could pass params on when you do POST -> GET pattern. My issue is mainly I can have 20 variables I need to maintain and push between a multi part call it would be nice if somehow I could do a view on them and then make my redirect call with something like "forward_all_view_params=true" but now I see that perhaps Flash is the mechanism to do this.  Main issue is how to do this without it being a pain. I use session for the stuff that always has to fly around. One thing I thought would be cool is if you pre-pended the param name with something like "_ " and just let the framework keep it until the request is fully routed back. So once I did a view("_catalogid", value) it just recognized it and maintained it forward. at the client page its referenced just as "catalogid", but then I found that flash() could do this and also you can redirect and add the parameter to that call as well. Its a convenience issue when you have a LOT of variables. I typically have about 15. 

Yeah, understand. However this looks like an edge case. If we implement it in the framework, we will have many strange questions: how many requests should data survive (flash only does one), where to keep data (request, session, application, etc.) and others  


It is good to hear that its at least 2x the jsf/hibernate or similar.  and hibernate was already better than the earlier j2e entitites. We have to remember, databases are optimized already and prepared statements are efficient. I got stuck on so many projects doing tons and tons of stored procs for simple cases and it always made the project late, yet when I showed them perf numbers that there were no differences they refused to change. 

Ditto! Do not optimize unless things are actually slow.  

One thing I was thinking on, just to prevent errors and catch them at compile time, is rather than the Model.set("colname", "value") pattern it might be interesting if the model could expose as Model.setMyTitle ("val")  I usually catch these errors fast but I think with the way instrumentation works as an inject into the class something might be possible. I always prefer to catch at compile time. And that way colnames would link into the tooltip suggestion from the dev ide. just a thought. 


I dont have anything brilliant to say. It works. Its pretty good with docs that are ... brief and require a few reads. ITs all there just... you might have to really read it a few times. Its human nature to just jump in though. So like I am learning more of how FLASH was meant to be used in the POST -> GET pattern I hadn't seen that at first. (maybe it wasnt there ;*>)


It was there :) However the docs are terse, and having to run two startups, I do not have much time for blogs/podcasts/tutorials and a book. 
If you have some bandwidth, I will help!

 
OH I did have some worry when I dont have a ID column if it will impact the models and performance. e.g. my mapping join table doesn't have a ID. 

No performance will be lost. Mostly some framework features will not be accessible.  

Oh one small thing. If you create a record row in the DB that has "record_version" but you leave record_version null, if you do an update it will throw an exception.  Probably this should be protected and just handle it in the framework to start with one as the value. This only happens if you create the record NOT USING ACTIVEJDBC so it's not quite a fair case, but with test data and other ways for things to create it comes up more often than one thinks. 

Ha, if this is the case, file an issue so we could add a better error message.  

I will maybe try to contribute to the framework on localization support if I ever get less than very busy. 

Actually it is already there: http://javalite.io/views#message-tag
 

I will add these last thoughts. I've tried MANY MANY MANY MANY frameworks. So many are here these days. This is the one that got me. None of the others lasted more than a hour. And that is due to clean design, clarity, power when needed, good encapsulation and separation of responsibilities, and you dont have to use a crappy language like ruby or generate massive amounts of pre-app-gen code just to start. you also dont have a phonebook to learn like spring. 


Awesome, as a framework designer these words are music to my ears (eyes really :)) 

I not too long ago went down the microsoft .net framework on a very big project and when we started using their ORM - linq for entities in its THIRD version it was massively buggy. Yes they got it fixed in ver 5 but my trust was ruined. Yes their MVC product is probably ok, but they just dont release quality. The few problems I found in javalite were all edge cases and for the most part you could go a different way and get things to work. 

I think I will try to do a tutorial video next. I think thats probably how I can help the most.  I will work on the controller test support and other parts that I due to speed and deadlines only touched at the beginning. this is a light framework, but it can be a very DEEP framework and powerful. and that is why I like it. 

Agree. It is as simple but has a serious punch! Let me know when you start on the tutorials -  I will guide you. 

Igor Polevoy

unread,
May 28, 2015, 2:35:55 PM5/28/15
to acti...@googlegroups.com


On Thursday, May 28, 2015 at 2:59:20 AM UTC-5, Gianna Giavelli wrote:
Reply all
Reply to author
Forward
0 new messages