<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><id>tag:blogger.com,1999:blog-1248732249041870352</id><updated>2008-07-25T13:41:47.717-07:00</updated><title type="text">Internna - Geared towards Open Source</title><link rel="alternate" type="text/html" href="http://internna.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default?start-index=26&amp;max-results=25&amp;redirect=false" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://internna.blogspot.com/feeds/posts/default" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><link rel="self" href="http://feeds.feedburner.com/InternnaOSS" type="application/atom+xml" /><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-2269689513708369442</id><published>2008-07-23T10:30:00.000-07:00</published><updated>2008-07-25T10:09:52.755-07:00</updated><title type="text">Invoking Web Services via Spring</title><content type="html">&lt;div style="text-align: justify;"&gt;SOA SOA SOA...SOA everywhere. Right now it's difficult to work on an enterprise project and don't have the need to connect to a WebService. What would we be without these buzzwords...?&lt;br /&gt;&lt;br /&gt;Unfortunately, for us developers that is, WebServices is not the easiest of technologies (understandable as the problem it solves is also complex) and Java's approach has always been guilty of not been the most intuitive. But the need is there so it has to be solved.&lt;br /&gt;&lt;br /&gt;To call a Web Service there are several possibilities at the framework level. The first is to use JAX-RPC but this approach is in disuse today (for uber complexity). If we stick to the standard the next API would be JAX-WS. This is a much more polished API based heavily on annotations. JAX-WS is now part of the standard Java Standard Edition. Finally there are other alternatives in the Open Source scene. And better, Spring, in some form or another, supports all of them (Groovy &lt;a href="http://blogs.sun.com/geertjan/entry/groovy_makes_web_services_embarrassingly" target="new"&gt;also helps&lt;/a&gt; but not everybody has access to it).&lt;br /&gt;&lt;br /&gt;It's important to notice that a developer has two ways to connect to a WS (I'll start talking about JAX-WS from now on), creating a SEI (Service Endpoint Interface) proxy or creating and sending a SOAP message. The first case allows the programmer to create a Java interface (mainly because actually it has to be annotated) and forget about the stub. The second (more powerful) alternative creates an XML structure from scratch. Spring facilitates the work with proxies. The later case requires the Spring Web Services subproject.&lt;br /&gt;&lt;br /&gt;So how does Spring help? In two ways, it dynamically creates the proxy and injects it to the business beans seamlessly. For the most advanced use Spring, as of now, still requires the Java interface to be provided. All in all, it's not a big deal as there's a tool (wsimport) to generate it given a WSDL. Any good IDE will do it as well. Actually, wsimport generates more than one Java source because the parameters probably require a JAXB (read Java to XML) transformation.&lt;br /&gt;&lt;br /&gt;I haven't talked about registries yet. JAXR is the Java API to connect to WSDL containers. They basically provide a level of indirection to a WSDL. JAXR is complicated (to some extent) and if possible I like the REST API better (but not all registries provide it!). IBM Service Registry &lt;a href="http://www.ibm.com/developerworks/websphere/techjournal/0805_peterson/0805_peterson.html" target="new"&gt;does&lt;/a&gt;, for example (so you can just use &lt;a href="http://www.dom4j.org/" target="new"&gt;Dom4J&lt;/a&gt; with &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/Authenticator.html" target="new"&gt;some security&lt;/a&gt;). Anyway, &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/remoting/jaxws/JaxWsPortProxyFactoryBean.html" target="new"&gt;JaxWsPortProxyFactoryBean&lt;/a&gt; (with minor tweaks) supports this kind of access.&lt;br /&gt;&lt;br /&gt;That should be all for the gross of the situations. Recall that JAX-WS supports WS-I Basic Profile, MTOM and other such advanced protocols by default. That's not true for all of them though! For example, it requires some work to allow for message level security. This is overcome by the use of &lt;a href="http://java.sun.com/javaee/5/docs/api/javax/xml/ws/handler/LogicalHandler.html" target="new"&gt;LogicalHandlers&lt;/a&gt; or &lt;a href="http://java.sun.com/javaee/5/docs/api/javax/xml/ws/handler/soap/SOAPHandler.html" target="new"&gt;SOAPHandlers&lt;/a&gt; (you can mix and match). In Spring or AOP jargon they would be called interceptors. They allow to modify the message prior to being wired. Another common and interesting use, for example, is logging. Spring allows handler injection grouped as &lt;a href="http://java.sun.com/javase/6/docs/api/javax/xml/ws/handler/HandlerResolver.html?is-external=true" target="new"&gt;HandlerResolvers&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So here's the final code:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;&amp;lt;bean id="loggingHandler" class="mypkg.LoggingHandler" /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id="defaultHandlerResolver" class="mypkg.ConfiguredHandlerResolver"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="handlers"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;list&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ref bean="loggingHandler" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/list&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/property&gt;&lt;br /&gt;&amp;lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id="wsdlRetriever" abstract="true" class="...JaxWsPortProxyFactoryBean"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="lookupServiceOnStartup" value="false" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="handlerResolver" ref="defaultHandlerResolver" /&gt;&lt;br /&gt;&amp;lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;bean id="aSample" parent="wsdlRetriever"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="serviceInterface" value="..Sample" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="wsdlDocumentUrl" value="http://...Sample?wsdl" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="serviceName" value="Sample" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="portName" value="SampleSOAP" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="namespaceUri" value="..." /&gt;&lt;br /&gt;&amp;lt;/bean&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Get the logging handler source code along a good explanation from &lt;a href="http://blogs.sun.com/sdimilla/entry/implementing_handlers_using_jaxws_2" target="new"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/343819677" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/343819677/invoking-web-services-via-spring.html" title="Invoking Web Services via Spring" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=2269689513708369442" title="1 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/2269689513708369442/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/2269689513708369442" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/2269689513708369442" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/07/invoking-web-services-via-spring.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-4996287233507446443</id><published>2008-07-08T05:13:00.000-07:00</published><updated>2008-07-08T06:07:17.456-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dwr sources" /><title type="text">Working with DWR sources</title><content type="html">&lt;div style="text-align: justify;"&gt;By now there's no doubt inside the software industry that the Open Source movement is here to stay. And the most valuable asset it provides is *hint* full access to the source code! And it's a shame that not that many people share this perception as for the majority of developers OSS just means free (read gratis) software.&lt;br /&gt;&lt;br /&gt;Of course, being free (gratis) is handy characteristic but it should not be one that bothers much to the gross of us, as we work for companies that can afford it anyway. On the contrary, source code should be of interest for you. Let me just list some of the most useful perks:&lt;ul&gt;&lt;li&gt;&lt;b&gt;It enables debugging&lt;/b&gt;&lt;br/&gt;Otherwise it becomes a blind and unproductive task. And believe me, the time spent debugging will be worth it.&lt;/li&gt;&lt;li&gt;&lt;b&gt;It's the best learning tool any programmer can access&lt;/b&gt;&lt;br/&gt;It's code written by very proficient hackers revolving common but hard to solve problems.&lt;/li&gt;&lt;li&gt;&lt;b&gt;It allows customizations&lt;/b&gt;&lt;br/&gt;And I include bug fixes here!&lt;/li&gt;&lt;li&gt;&lt;b&gt;It makes you part of a community&lt;/b&gt;&lt;br/&gt;Share your code, discuss problems, hear other viewpoints, propose solutions et al!&lt;/li&gt;&lt;/ul&gt;IMHO fear is the main reason that prevents many programmers to contribute to the scene. But if you're by now convinced of the utility let me demystify the myths! Just follow with me this step by step tutorial to work with DWR source code :-)&lt;br /&gt;&lt;br /&gt;Our first task is gaining access to the source code. DWR as many other projects stores the code in a repository. Beware that repositories are not like open wikis and people have different access rights. Anonymous access is the best we can hope for by now. There are many different server types (SCM), DWR has used CVS in the past but right now uses &lt;a href="http://subversion.tigris.org/" target="new"&gt;Subversion&lt;/a&gt;. We need to have a client installed to access a SVN repository and I can recommend &lt;a href="http://tortoisesvn.tigris.org/" target="new"&gt;Tortoise&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The repository is available at &lt;a href="http://svn.directwebremoting.org/dwr/" target="new"&gt;http://svn.directwebremoting.org/dwr/&lt;/a&gt;. It's huge as it includes all the versions ever released so it's probably better to point to the trunk folder (the latest code is available there) or, may be, branches/Branch_2_0/ (where the the code for the previous version lies).&lt;br /&gt;&lt;br /&gt;To download the code to our machine we use the &lt;i&gt;checkout&lt;/i&gt; command. The &lt;i&gt;export&lt;/i&gt; command can be an option if there's no interest in having later updates. DWR has a page with detailed explanations for this step at &lt;a href="http://directwebremoting.org/dwr/development" target="new"&gt;their site&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once we have it there we can explore it a little bit further. There are three important subfolders: core (DWR), serverside (different plugins) and ui (client side code).&lt;br /&gt;&lt;br /&gt;There's also there a folder named &lt;i&gt;etc&lt;/i&gt; that contains project files for different IDEs (netbeans, eclipse, IDEA). Opening DWR inside an IDE is as easy as navigating to the correct folder and opening the matching project. Opening the project in an IDE has the added benefit of allowing quick debugging of changes and their influence in your application.&lt;br /&gt;&lt;br /&gt;Alternatively, DWR can be compiled using Ant (by just typing &lt;i&gt;ant&lt;/i&gt; at the top of the hierarchy!). Regardless of the method, the compiled classes are always put in the (automatically) created &lt;i&gt;target&lt;/i&gt; folder.&lt;br /&gt;&lt;br /&gt;Some projects have an extensive documentation available. DWR does not particularly shine in this area (intentionally many times!) but, at least, things are organized so finding something should be manageable. For example, all the Spring integration classes are available inside the serverside/spring folder and are bound to just one package.&lt;br /&gt;&lt;br /&gt;And that's all basically. Some simple steps that have configured DWR inside your workspace and facilitate your development needs. And once it's there nothing prevents you to dive a little and improve the tool ;-)&lt;br /&gt;&lt;br /&gt;Happy hacking!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/329808862" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/329808862/working-with-dwr-sources.html" title="Working with DWR sources" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=4996287233507446443" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/4996287233507446443/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4996287233507446443" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4996287233507446443" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/07/working-with-dwr-sources.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-868087077469090258</id><published>2008-06-28T03:38:00.000-07:00</published><updated>2008-06-28T04:36:57.774-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><title type="text">IWebMvc 1.0</title><content type="html">&lt;div style="text-align: justify;"&gt;Last week I silently released &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;IWebMvc latest version&lt;/a&gt;, labeled 1.0. Finally, I'll add! I've been working for six months to reach this point and I'm quite proud of the result. Even more so if I consider it's been a one man effort all the way from the start.&lt;br /&gt;&lt;br /&gt;IWebMvc is a complete framework for dealing with enterprise applications with a JEE/Spring backend and an AJAX frontend. It's also the result of my experience as an architect (what a devalued title nowadays!) and my contribution to the community. I think it's a well built platform and a good (working) example to understand very complex technologies.&lt;br /&gt;&lt;br /&gt;Unfortunately, it can't be any more. IWebMvc competes in a very crowded space against other projects like JSF/Richfaces, Grails or Wicket (among others!). All of them are supported by either big corporations, companies or foundations that can provide many resources. I just can't keep up! I have a work, contributions to other OSS projects, IWebMvc and a real life. Just too much. During the last month or so I've being lagging behind so a decision had to be made.&lt;br /&gt;&lt;br /&gt;That said, IWebMvc has reached a state that can be of use to many as it provides:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Full Spring support&lt;/b&gt;&lt;br/&gt;Including Webflow 2.0 and Security 2.0 and working code to configure transactions, AOP, MVC (controllers, locales, AJAX) and all.&lt;/li&gt;&lt;li&gt;&lt;b&gt;JPA support&lt;/b&gt;&lt;br/&gt;A generic service to persist entities using Hibernate as the provider. Includes solutions for many problems common to any application (full text search, transactions, DAO hierarchies, filters, complex relations, multiple DB/server support, automatic schema creation).&lt;/li&gt;&lt;li&gt;&lt;b&gt;AJAX&lt;/b&gt;&lt;br/&gt;IWebMvc offers, hands down, the most complete DWR 3.0 integration (for pull requests) out there. &lt;/li&gt;&lt;li&gt;&lt;b&gt;Project configuration&lt;/b&gt;&lt;br/&gt;Working scripts to kick start a project, download transitive dependencies, compile, test and package everything, deploy to an embedded server or integrate with a CI server.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Widgets&lt;/b&gt;&lt;br/&gt;Dozens of them based on dojo! And Google AJAX APIs! Many of them original to the project&lt;/li&gt;&lt;li&gt;And many more useful utilities like cahing, compression, encryption, user administration, audits, CRUD operations, themes, sound &amp; video support, captcha, multi-file upload and more&lt;/li&gt;&lt;/ul&gt;At this point, my only regrets have been not being able to finish the documentation and not being able to test it as much as I'd have liked in IE.&lt;br /&gt;&lt;br /&gt;Finally I would like to thank you all the people that have supported the project like &lt;a href="http://code.google.com" target="new"&gt;Google&lt;/a&gt;, &lt;a href="http://www.zeroturnaround.com/" target="new"&gt;ZeroTurnAround&lt;/a&gt;, &lt;a href="http://java.dzone.com/"&gt;JavaLobby&lt;/a&gt;, Joe Walker (of DWR fame), &lt;a href="https://jawr.dev.java.net/" target="new"&gt;JAWR&lt;/a&gt; and all the developers that have contacted me with offering help, ideas, critics, opinions or just to say thank you!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/321980163" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/321980163/iwebmvc-10.html" title="IWebMvc 1.0" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=868087077469090258" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/868087077469090258/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/868087077469090258" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/868087077469090258" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/06/iwebmvc-10.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-3797418646177361783</id><published>2008-06-22T01:40:00.000-07:00</published><updated>2008-06-23T02:27:43.985-07:00</updated><title type="text">div lightbox with jQuery</title><content type="html">&lt;div style="text-align: justify;"&gt;I know there are next to thousands of &lt;a href="http://www.huddletogether.com/projects/lightbox2/" target="new"&gt;lightbox&lt;/a&gt; versions, including several built over &lt;a href="http://jquery.com/" target="new"&gt;jQuery&lt;/a&gt;. But you know, none of them seem to fit your needs ever. This time around I was looking for one that could enhance parts of the page and not specifically images. &lt;a href="http://jquery.com/demo/thickbox/" target="new"&gt;Thickbox&lt;/a&gt; can present inline content (divs or iFrames) but it's not as pretty as others and it has some nasty CSS side effects. In addition it wasn't correctly working in IE6 for some corner cases and the syntax was (somehow) weird.&lt;br /&gt;&lt;br /&gt;After a little search I found &lt;a href="http://leandrovieira.com/projects/jquery/lightbox/" target="new"&gt;this plug-in&lt;/a&gt; from Leandro Vieira. It resembled the original lightbox plugin but, unfortunately, it was designed to view just images (alone or as a gallery). After realizing I was not going to get what I was looking for without some effort I decided to stick with it and modify it to suit my needs which basically where:&lt;ul&gt;&lt;li&gt;Visually attractive&lt;/li&gt;&lt;li&gt;HTML, Flash, other jQuery plugins as content&lt;/li&gt;&lt;li&gt;Working in FF, IE6+, Safari&lt;/li&gt;&lt;li&gt;Working inside a frameset&lt;/li&gt;&lt;li&gt;Simple to use (nothing beyond $("#id").lightbox())&lt;/li&gt;&lt;/ul&gt;Take into account that this is a hack as I wasn't expecting to release it in any form. A good solution would integrate with the original code and not just replace it! So I'm not going to explain the code in detail (or at all) but, for those interested, here are the modifications required:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;settings = jQuery.extend({&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;timeout:                -1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;hideOnClickOutside:     false,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;alreadyOpened:          false&lt;br /&gt;}, settings);&lt;br /&gt;&lt;br /&gt;function _initialize() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;_start(this, jQueryMatchedObj)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(document).keydown(function(objEvent) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_keyboard_action(objEvent)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;})&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (settings.timeout != -1)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setTimeout("$('#lightbox-secNav-btnClose').click()", settings.timeout)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return false&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function _start(objClicked,jQueryMatchedObj) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (!settings.alreadyOpened) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;settings.alreadyOpened = true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$('embed, object, select').css({ 'visibility' : 'hidden' });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_set_interface();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;settings.placeHolder = objClicked&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;_set_image_to_view();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$("#lightbox-image object").css("visibility", "visible")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$("#lightbox-image embed").css("visibility", "visible")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$("#lightbox-image object embed").css("visibility", "visible")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function _set_image_to_view() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$('#lightbox-image,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#lightbox-nav,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#lightbox-nav-btnPrev,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#lightbox-nav-btnNext,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#lightbox-container-image-data-box,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#lightbox-image-details-currentNumber').hide();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(settings.placeHolder).appendTo($("#lightbox-image"))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;elem = $("#lightbox-image")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;_resize_container_image_box(elem.width(), elem.height())&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The CSS had to be slightly modified as well. And finally (for the lazy ones) &lt;a href="http://internna.googlecode.com/files/jQueryDivLB.war" target="new"&gt;here's a sample&lt;/a&gt;. It's a WAR file, if you don't have a servlet container available just uncompress and change the paths. To access it in your localhost http://localhost:[8080]/demo/index.jsp (or flash.jsp, frames.jsp, carousel.jsp).&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/317983519" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/317983519/div-lightbox-with-jquery.html" title="div lightbox with jQuery" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=3797418646177361783" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/3797418646177361783/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3797418646177361783" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3797418646177361783" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/06/div-lightbox-with-jquery.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-7110345743479404047</id><published>2008-06-17T08:37:00.000-07:00</published><updated>2008-06-17T09:36:56.048-07:00</updated><title type="text">jQuery effects</title><content type="html">&lt;div style="text-align: justify;"&gt;One of the lastest tasks (in addition to some OSS work) I've been working on has been a framework to show asynchronous messages to a logged user. These messages usually are loaded in a placeholder that is then presented on the screen using some kind of effect (like fading or sliding). They range from very intrusive to mildly annoying (heck..I'm being payed!). Examples include the simplest pre-positioned banner, the modal lightbox, the interstitial or the inline popup among others.&lt;br /&gt;&lt;br /&gt;As many know, I'm a big fan of the &lt;a href="http://dojotoolkit.org/" target="new"&gt;dojo toolkit&lt;/a&gt; and I promote it as much as I can. I have to admit that one of the things I like most is the widget library (named dijit). Unfortunately, this time around I didn't need one and dojo's effects (dojo.fx) are less than stellar. Add some troubles related to the number of files to deploy (I'm just talking about the dojo core) and I was quickly looking for an alternative.&lt;br /&gt;&lt;br /&gt;The first one I inspected was jQuery as it's packaged in a single (tiny) file, has gathered a supportive community and it's always been tagged as really simple to use. By haphazard, the UI team ahd just released a new version so I started there. Let's start by saying that jQuery UI is not a fully featured component library but, good for me, it does pack a number of effects (ala &lt;a href="http://script.aculo.us/"&gt;scriptaculous&lt;/a&gt;). There's a &lt;a href="http://ui.jquery.com/repository/real-world/effects/" target="new"&gt;demo page&lt;/a&gt; available that I recommend visiting. And can be extended with plugins easily (I used for example &lt;a href="http://jquery.com/demo/thickbox/" target="new"&gt;thickbox&lt;/a&gt; and &lt;a href="http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html" target="new"&gt;liScroll&lt;/a&gt;). I didn't bothered to look beyond :-)&lt;br /&gt;&lt;br /&gt;So, here's my stance on the library:&lt;ul&gt;&lt;li&gt;It works. And that's a lot to say when testing with IE6, FF3RC &amp; Safari. In fact, it works from the start and without ugly hacks (and, my God, I'm used to those!)&lt;/li&gt;&lt;li&gt;I came thinking it was easy to use and I wasn't disappointed. As long as you are proficient with JS/CSS (functions, callbacks, selectors) it's very intuitive. For example, I found rather easier to make a container movable using jQuery's &lt;i&gt;$("id").draggable()&lt;/i&gt; than dojo's &lt;i&gt;new dojo.dnd.Moveable("id")&lt;/i&gt; (although both are actually quite straightforward)&lt;/li&gt;&lt;li&gt;Chaining is a bless though it's used without measure in the framework! Please, be sure to understand &lt;a href="http://www.martinfowler.com/bliki/FluentInterface.html" target="new"&gt;fluent interfaces&lt;/a&gt; beforehand.&lt;/li&gt;&lt;li&gt;The API is clear yet very powerful. The UI effects are awesome. The people in my project were amazed when I demoed the prototype. Nobody could believe a single line of code could generate that results.&lt;/li&gt;&lt;li&gt;Of course, all this goodies are of no use if you need widgets though..The UI team has a daunting task there.&lt;/li&gt;&lt;/ul&gt;All in all, a completely different approach to JS than dojo where there's a function/package/module for (nearly) everything. jQuery is concise but with its simplicity it also brings efficiency and saves time and troubles. Even more so if the developer is not that well versed in the intricacies of javascript (and I reckon there are many).&lt;br /&gt;&lt;br /&gt;In short, I expect to use it again soon, without doubts.&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/313916321" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/313916321/jquery-effects.html" title="jQuery effects" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=7110345743479404047" title="3 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/7110345743479404047/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7110345743479404047" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7110345743479404047" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/06/jquery-effects.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-4608868867515810913</id><published>2008-05-26T12:20:00.000-07:00</published><updated>2008-05-26T12:44:07.963-07:00</updated><title type="text">IWebMvc Milestone 5 released</title><content type="html">&lt;div style="text-align: justify;"&gt;I expected to have a Release Candidate by now but I couldn't get it in time so I'm releasing an intermediate release, Milestone 5, that packs a couple new widgets along with preliminary documentation. It's available at &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;the repository&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The first widget deals with addresses and integrates Google Maps with IWebMvc. A nice feature to have indeed.&lt;br /&gt;&lt;br /&gt;The second adds sound (MP3) support based on &lt;a href="http://www.schillmania.com/projects/soundmanager2/"&gt;Sound Manager 2&lt;/a&gt;, a nice JS library. It includes a really well shaped player.&lt;br /&gt;&lt;br /&gt;The codebase is frozen and just bug fixes (mainly in IE7) till the 1.0 release which I expect will be soon.&lt;br /&gt;&lt;br /&gt;PS.- IWebMvc loads the browser with requests and hits the two connection per server limit pretty fast. FF3 has upped the limit to eight concurrent connections (IE8 has done it as well but dojo is still unsupported there) so it's highly recommended!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/298578275" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/298578275/iwebmvc-milestone-5-released.html" title="IWebMvc Milestone 5 released" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=4608868867515810913" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/4608868867515810913/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4608868867515810913" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4608868867515810913" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/05/iwebmvc-milestone-5-released.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-7178738541532357040</id><published>2008-05-11T10:17:00.000-07:00</published><updated>2008-05-12T02:22:27.349-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="robot" /><category scheme="http://www.blogger.com/atom/ns#" term="bot" /><title type="text">Creating a playing bot in Java</title><content type="html">&lt;div style="text-align: justify;"&gt;So, I've just read an interesting article at DZone &lt;a href="http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot" target="new"&gt;about how to build a poker bot today&lt;/a&gt;. Nonetheless it was somehow misleading. After reading it, one can get the impression that to build a bot C++ knowledge is a prerequisite. And advanced Windows programming as well. In all fairness, they are not.&lt;br /&gt;&lt;br /&gt;In fact, any developer with basic Java understanding can code a bot in less than a day. Of course, everything depends on the kind of game...a table game (read Poker or BlackJack) is achievable. WoW is not. I'll show you how building a roulette bot in Java step by step.&lt;br /&gt;&lt;br /&gt;First of all, I won't provide the FULL source code. Gambling (and even more so online gambling) bears some subtleties that make it hazardous. That's also the reason I've chosen roulette: no bot or betting system can ever beat the house edge in the log run (read &lt;a href="http://wizardofodds.com/" target="new"&gt;the wizard of odds&lt;/a&gt; if in doubt). This is good for us though, the bot is useless (in the long run) so the reader should be just interested in the techniques and not the product.&lt;br /&gt;&lt;br /&gt;Roulette is a simple game. Past events cannot influence the outcome of future spins so a player just needs to place his bets and wait until the ball lands in a number. Of course some AI would be useful though. But in the end the bot just needs to be able to bet and recognize the table state.&lt;br /&gt;&lt;br /&gt;So basically there's an input and some actions. The input needs to be captured from the screen and the actions are performed controlling the mouse. This tasks can be done using a Java class, java.awt.Robot.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The OCR&lt;/b&gt;&lt;br /&gt;Trying to get true OCR is not really feasable. Fortunately, there's a shortcut. First, the bot just needs to scan portions of the screen, second the data is fixed and third the screen is updated from time to time. For example, when the bot wants to scan the outcome of a spin just needs to check for numbers 0 to 36 in some fixes coordinates.&lt;br /&gt;&lt;br /&gt;The first task of the bot developer is to save image files with all the possible outcomes. In roulette this means 40 images (37 numbers and three extra button images to check if the bot can bet at a given time). I use &lt;a href="http://www.autoitscript.com/autoit3/" target="new"&gt;AutoIt Window Info&lt;/a&gt; to get screen coordinates quickly. Then it's a question of using the createScreenCapture method of the Robot class and the Java ImageIO API to save a PNG of each location.&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;Rectangle spinResultArea = new Rectangle(100, 100, 50, 15);&lt;br /&gt;BufferedImage res = robot.createScreenCapture(spinResultArea);&lt;br /&gt;ImageIO.write(res, "png", new File(...));&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Once generated (the code is disposable now) the images must be packaged inside the JAR and loaded using:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;InputStream img = getClass().getResourceAsStream("/resources/0.png");&lt;br /&gt;BufferedImage number = ImageIO.read(img);&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;As a matter of fact, it's better to have an array of pixels to make the comparisons so:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;protected int[] getData(BufferedImage im) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int[] rgb = new int [im.getWidth() * im.getHeight()];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;image.getRGB(0, 0, im.getWidth(), im.getHeight(), rgb, 0, im.getHeight());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return rgb;&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Load all the images on startup and save the generated arrays in a List for later. The last part of the OCR routine is comparing images. This is easy:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;int[] rgb = getData(sourceImg);&lt;br /&gt;Arrays.equals(rgb, numbers.get(number))&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;b&gt;The mouse&lt;/b&gt;&lt;br/&gt;The Robot class controls the mouse (or keyboard) fine. A simple function will suffice:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;protected void click(int[] screenPosition) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.mouseMove(screenPosition[0], screenPosition[1]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.delay(75);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.mousePress(InputEvent.BUTTON1_MASK);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.delay(150);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.mouseRelease(InputEvent.BUTTON1_MASK);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;robot.delay(150);&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The code is self explanatory really. Read the javadoc if in doubt.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The AI&lt;/b&gt;&lt;br /&gt;The bot should be fully functional by now. Of course, it's not very intelligent. All bots need some kind of AI. And unfortunately, the AI is probably the difficult part. For roulette the AI is limited to selecting a betting system and coding it. The &lt;a href="http://wizardofodds.com/gambling/tenbet.html" target="new"&gt;cancellation system&lt;/a&gt; should work. Just one advice here, use unit tests! The number of combinations for a table game is huge so manually testing them becomes a daunting task really quick. Creating unit tests, in addition to saving time, ensures the code is bug free (to some extent) which comes handy when playing for real money, I guess.&lt;br /&gt;&lt;br /&gt;And that's really all it takes. No DLL hooks or C++ ;-)&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/288163539" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/288163539/creating-playing-bot-in-java.html" title="Creating a playing bot in Java" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=7178738541532357040" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/7178738541532357040/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7178738541532357040" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7178738541532357040" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/05/creating-playing-bot-in-java.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-3672997711954485389</id><published>2008-04-29T07:36:00.000-07:00</published><updated>2008-04-29T08:01:49.128-07:00</updated><title type="text">IWebMvc Milestone 4 released</title><content type="html">&lt;div style="text-align: justify;"&gt;So a new version is up. This time the feature list is heavy on the server side. Let's review them one by one:&lt;ul&gt;&lt;li&gt;&lt;b&gt;License change&lt;/b&gt;&lt;br/&gt;I'm not sure it's the best time to announce it...but from now on IWebMvc will be released under the Apache Software License (ASL 2). I've waited till today just because the initial versions were very preliminary and GPL just keeps things under control. Things have changed and IWebMvc has nearly reached the point where other people can probably contribute better ideas than me.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Groovy support&lt;/b&gt;&lt;br/&gt;I've talked about it recently so I'm not adding much here. It supports compiled classes and scripted (dynamic) beans. Just be careful with the IDE support. In particular with Netbeans, at least until v6.5&lt;/li&gt;&lt;li&gt;&lt;b&gt;Spring Webflow 2.0 support&lt;/b&gt;&lt;br/&gt;So SWF published the first RC last week and IWebMvc already includes it. Nice! It's very well integrated with the rest of the framework, in particular with MVC, JPA, Security and AJAX. I pretend to blog about this feature in the near future.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Jasper Reports / Dynamic Jasper support&lt;/b&gt;&lt;br/&gt;PDF &amp; Excel file download. Automatic grid reports in less than 20 lines of code! Really useful for statistics in the future.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Multi file upload&lt;/b&gt;&lt;br/&gt;Upload documents and images in multiples and group them in the server. Including a specific widget.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Image Gallery widget&lt;/b&gt;&lt;br/&gt;Show grouped images as a thumbnail strip or as a slideshow with one line of code!&lt;/li&gt;&lt;li&gt;&lt;b&gt;Rating widget&lt;/b&gt;&lt;br/&gt;A new way to bind numbers using the latest dojo widget.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Miscellaneous&lt;/b&gt;&lt;br/&gt;Several bug fixes and Eclipse support were also improved. Glassfish configuration as well. Check the changelog if interested!&lt;/li&gt;&lt;/ul&gt;As always, the code along with a new screencast of the features is available at &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;the project's download page&lt;/a&gt;. I've to thank you the Google code team for doubling the available space for IWebMvc!&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/280141206" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/280141206/iwebmvc-milestone-4-released.html" title="IWebMvc Milestone 4 released" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=3672997711954485389" title="1 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/3672997711954485389/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3672997711954485389" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3672997711954485389" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/iwebmvc-milestone-4-released.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-3088431554720411805</id><published>2008-04-26T02:55:00.000-07:00</published><updated>2008-04-27T03:34:18.413-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><category scheme="http://www.blogger.com/atom/ns#" term="Groovy" /><title type="text">Mixed feelings adding Groovy support</title><content type="html">&lt;div style="text-align: justify;"&gt;One of the purposes I had for this year was &lt;a href="http://internna.blogspot.com/2008/01/choosing-dynamic-language-to-learn.html" target="new"&gt;learning Groovy&lt;/a&gt;. And, since the beginning, I knew IWebMvc was going to support Groovy although I didn't have a real clue about the extension of this support. During the last week I've worked to get both things done. As a matter of fact, it was easy and I learned a couple or three things in the process that may be of interest to some Groovy beginners (like me). Let's start with the cool features:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Prototyping&lt;/b&gt;&lt;br/&gt;Scripting is FAST and it really saves time. If you're like me and start coding just to get an idea of the problem and explore possible solutions this feature alone makes Groovy worth the effort. It boosts productivity by an order of magnitude!&lt;/li&gt;&lt;li&gt;&lt;b&gt;Spring support&lt;/b&gt;&lt;br/&gt;Well..Spring is always good, isn't it? Unless you're using JavaRebel (and enjoying it already), refreshable beans are a bless. And it also allows (encourages?) quick &amp; dirty hacks ;-)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Groovy beans&lt;/b&gt;&lt;br/&gt;I migrated the Domain model of IWebMvc to Groovy. I don't know the lines of code that where removed in the process. A boilerplate killer!&lt;/li&gt;&lt;li&gt;&lt;b&gt;Language entensions&lt;/b&gt;&lt;br/&gt;GStrings and Object extensions (read Collection) are outstanding. I won't even mention closures (you should be used to them via Javascript). Really useful&lt;/li&gt;&lt;li&gt;&lt;b&gt;Choice&lt;/b&gt;&lt;br/&gt;Better let the developer choose which language is better suited for a particular problem. IMHO any modern Java based framework should include Groovy support.&lt;/li&gt;&lt;/ul&gt;I had a so-so feeling about some things though:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Groovy != Java&lt;/b&gt;&lt;br/&gt;This may come as a surprise to some (it was for me) and be obvious for others (heck it's Groovy and not Java!). The fact is the relation is tight: they both work in the JVM, can work together and share syntax but..they're different. Subtle differences really but some that make impossible to rename your Java classes to .groovy and expect your application to work.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Groovyc&lt;/b&gt;&lt;br/&gt;Joint compilation is a very intelligent idea and Groovyc works very well but it's not on the same league as Javac. It lacks maturity, reliability and speed. I hope Sun can help the Groovy team as they did with JRuby.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Migration&lt;/b&gt;&lt;br/&gt;After adding Groovy support to IWebMvc I was forced to move some code to Groovy even if just to serve as an example. I had mixed feelings with the results. Groovy is amazing to improve productivity but you miss that when you have an already working code. And then there's the static typing issue..I wasn't happy to loose it. At all (I guess my code is not that groovysh)&lt;/li&gt;&lt;/ul&gt;Finally there were things I just plain disliked:&lt;ul&gt;&lt;li&gt;&lt;b&gt;IDE support&lt;/b&gt;&lt;br/&gt;I'm a Netbeans user. There's no current Groovy plug-in that works with 6.1RC2 out-of-the-box. You may try to install one from the Development Update Center (I couldn't). One doesn't know how much he relies on things like syntax highlighting (let's not say debugging!)...IDE support in Netbeans is bluntly put, awful.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Generics&lt;/b&gt;&lt;br/&gt;Are Generics in open confrontation with dynamic typing? I guess they are. Java support for Generics is mild...Groovy's...much worse.&lt;/li&gt;&lt;/ul&gt;All in all, Groovy IS the future. I'm quite sure I'll be using it extensively. Unfortunately, today and with Netbeans is not ready for prime time.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/278203393" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/278203393/mixed-feelings-adding-groovy-support.html" title="Mixed feelings adding Groovy support" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=3088431554720411805" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/3088431554720411805/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3088431554720411805" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3088431554720411805" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/mixed-feelings-adding-groovy-support.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-1433485081656525434</id><published>2008-04-15T00:47:00.000-07:00</published><updated>2008-04-15T01:13:22.036-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><category scheme="http://www.blogger.com/atom/ns#" term="zeroTurnAround" /><category scheme="http://www.blogger.com/atom/ns#" term="JavaRebel" /><title type="text">IWebMvc receives a JavaRebel free OSS development license</title><content type="html">&lt;div style="text-align: justify;"&gt;I received it in the mail yesterday and I'm eager to start using it. For those that don't now &lt;a href="http://www.zeroturnaround.com/javarebel/" target="new"&gt;JavaRebel&lt;/a&gt; is an astounding tool that lets a developer reload modified classes during runtime. This means that once an application is deployed it will automatically detect changes in class files and transparently apply them! Only Weblogic 10.3 seems to have a feature like it..at how many times the price!!&lt;br /&gt;&lt;br /&gt;The best of all is that ZeroTurnAround people are working hard to get Spring support working. In fact, Spring works per se but they want to get automatic configuration reload so bean state is kept. Awesome isn't it? And other proxy libraries as well (JavaAssist, CGLIB and such). IMO it's one of the most interesting technologies right now and one to watch this year.&lt;br /&gt;&lt;br /&gt;Thank you JavaRebel! And thank you for supporting OSS projects! Even those as less known (yet) as IWebMvc.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/270548330" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/270548330/iwebmvc-receives-javarebel-free-oss.html" title="IWebMvc receives a JavaRebel free OSS development license" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=1433485081656525434" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/1433485081656525434/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/1433485081656525434" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/1433485081656525434" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/iwebmvc-receives-javarebel-free-oss.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-5137536636855042062</id><published>2008-04-13T07:57:00.000-07:00</published><updated>2008-04-13T08:09:52.561-07:00</updated><title type="text">IWebMvc CRUD Screencasts. Learn the framework</title><content type="html">&lt;div style="text-align: justify;"&gt;During the last month I've been asked the same question time and again, people somehow feel that IWebMvc demo is cool but have many many doubts about how to make use of it. In fact, if IWebMvc lacks something at the moment that's documentation! Well, I had some time during the weekend so I decided to invest it creating two little videos. Both of them show how easily you can leverage IWebMvc functionality in your application.&lt;br /&gt;&lt;br /&gt;The first one explains how to add a new (somehow simple) entity that uses a couple of the framework widgets and how the DB schema is automatically generated and the developer gets CRUD operations &amp; security in less than 30 lines of code.&lt;br /&gt;&lt;br /&gt;The later tries to go a step further and use an entity inside other entities while getting full text search and RSS feeds in the process. By the way, it uses a custom view instead of those provided by default.&lt;br /&gt;&lt;br /&gt;Both together give a quick glimpse of the CRUD possibilities of IWebMvc. They're available at &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;the project download page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy them! And help share the news!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/269485840" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/269485840/iwebmvc-crud-screencasts-learn.html" title="IWebMvc CRUD Screencasts. Learn the framework" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=5137536636855042062" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/5137536636855042062/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/5137536636855042062" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/5137536636855042062" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/iwebmvc-crud-screencasts-learn.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-4065782363102276727</id><published>2008-04-13T04:59:00.000-07:00</published><updated>2008-04-13T07:42:45.578-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><category scheme="http://www.blogger.com/atom/ns#" term="Web Framework Smackdown" /><title type="text">Web Framework Smackdown Questions: IWebMvc</title><content type="html">&lt;div style="text-align: justify;"&gt;Other frameworks have already answered (&lt;a target="new" href="http://sabob.blogspot.com/2008/04/web-framework-smackdown-questions-click.html"&gt;Click&lt;/a&gt;, &lt;a href="http://tapestryjava.blogspot.com/2008/03/web-framework-smackdown-tapestry.html" target="new"&gt;Tapestry&lt;/a&gt;) &lt;a href="http://raibledesigns.com/rd/entry/the_web_framework_smackdown_questions" target="new"&gt;Matt's questions&lt;/a&gt; so I'm doing it as well:&lt;ul&gt;&lt;li&gt;&lt;b&gt;What is the overall performance of your framework as it compares to others?&lt;/b&gt;&lt;br/&gt;No benchmarks have been passed yet but IWebMvc makes full use of Spring MVC / Hibernate on the server side and DWR / dojo on the client. Performance should be on par with those libraries.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;How does your web framework position themselves in relation to Web Beans?&lt;/b&gt;&lt;br/&gt;JSF / EJB3 is a powerful stack but it cannot stand the visuals and possibilities of dojo on the client and the flexibility Spring + JPA offers on the server.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;How easy is it to create a re-usable component in your framework? Is it as easy as sub-classing an existing component?&lt;/b&gt;&lt;br/&gt;A new component is composed of a tag lib wrapping the client code and a JPA entity that serves as backend. The most complex components may required a specific Spring data binder. There are several (ten or more) examples for each of these. Framework components are designed to be extensible by nature. All server operations are generic and will work for any new component (CRUD, RSS, security...)&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;What is the key differentiating characteristic of your framework that makes it better than the rest?&lt;/b&gt;&lt;br/&gt;The base is impressive and rock solid (JEE / Spring (AOP, MVC, ORM, TX, Security) / JPA (Hibernate) /DWR / dojo) and IWebMvc just starts there. So basically you get a working application based on those technologies and lots of goodies to make the developer life easier. In addition, choosing such a fixed stack ensures a tight integration between each layer.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;What do you think about the various scopes introduced by Seam, e.g. conversation vs request or session? If you support these additional scopes, do you also provide some sort of concurrency control?&lt;/b&gt;&lt;br/&gt;IWebMvc will support out-of-the-box Spring Webflow integration in the near future.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Why can't we, the Java Community, come together and adopt the best application framework and settle the web development subject?&lt;/b&gt;&lt;br/&gt;Innovation is key in this world. Each framework offers something new and different. IWebMvc probably offers the best DWR / dojo integration with server side technologies available to date.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;What are you doing to help with developer productivity?&lt;/b&gt;&lt;br/&gt;That's the main goal indeed! Working project scripts (compile, dependency management, QA), generic controllers and functionality, pre-built common tasks, wrapped client code, powerful stack, screencasts &amp; documentation. Everything points in that direction. IWebMvc is a framework aimed at developers.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;2008 is a huge year for the mobile web. How do you help developers build great mobile web applications?&lt;/b&gt;&lt;br/&gt;I'm not sure IWebMvc fits the bill here or if some other frameworks are better suited.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;If you couldn't use your framework, what would you use and why?&lt;/b&gt;&lt;br/&gt;I guess bare Spring MVC / Webflow / DWR / JPA and rebuild some work from there. Another route would be Grails.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;How do you enable rich Ajax applications?&lt;/b&gt;&lt;br/&gt;IWebMvc was designed with AJAX in mind and cannot really be used otherwise. All widgets support and use AJAX extensively.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Can a developer make a change to source, and hit RELOAD in the browser to see the change? If not, why not?&lt;/b&gt;&lt;br/&gt;No problem with client side code (JSP, tag libs, JS, CSS). Java / Spring beans / JPA entities requires the use of and additional product like JavaRebel (or Weblogic 10.3) or a plain restart (to update the DB schema for example).&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;What do you think about the whole Flex revolution, and do you think you are competitors to this technology?&lt;/b&gt;&lt;br/&gt;In some ways we do as IWebMvc offers a lot of client side code. Flex is an interesting technology and so is AJAX. Both are well suited for web develoment. IWebMvc prefers the later because it saves the developer the need of learning a new language and because target applications are more likely to be of the enterprise class rather than highly interactive Flash enabled sites.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;How easy is it to create a module and plug it into a bigger application, complete with configuration, code, and view?&lt;/b&gt;&lt;br/&gt;Framework and application code are clearly separated. But in truth, as of now, IWebMvc is not designed to create plugins but complete web / enterprise applications. Nonetheless, as long as you keep the Spring configuration in a different XML file and use a different namespace for your sources, with a little extra work everything should be fine.&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/269470514" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/269470514/web-framework-smackdown-questions.html" title="Web Framework Smackdown Questions: IWebMvc" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=4065782363102276727" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/4065782363102276727/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4065782363102276727" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/4065782363102276727" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/web-framework-smackdown-questions.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-6956388994911197993</id><published>2008-04-10T03:31:00.000-07:00</published><updated>2008-04-10T04:55:15.671-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><title type="text">IWebMvc Milestone 3 released</title><content type="html">&lt;div style="text-align: justify;"&gt;I've been working hard to polish a lot of aspects of IWebMvc for this milestone 3 and finally today I've finished. The result is a much more mature product that starts to resemble a usable framework. Nonetheless, I had time to add new features as well, some of them really important!&lt;br /&gt;&lt;br /&gt;Let's review some of them:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Security&lt;/b&gt;&lt;br/&gt;IWebMvc now supports Spring security 2.0 based authentication and authorization using the new security namespace possibilities.&lt;ul&gt;&lt;li&gt;&lt;b&gt;Spring Security 2.0 RC1&lt;/b&gt;&lt;br/&gt;The new version of Acegi is fully configured. Declarative security enabled.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Database realm&lt;/b&gt;&lt;br/&gt;Users / Roles are persisted in DB as any other entity.&lt;/li&gt;&lt;li&gt;&lt;b&gt;User Administration&lt;/b&gt;&lt;br/&gt;CRUD operations to add / edit users, assign permissions and toggle (enable/disable) them are provided out-of-the-box.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Login / log off widget&lt;/b&gt;&lt;br/&gt;Working and easily integrated form based authentication. Default user/password combination is iwebmvc/iwebmvc (change it in iwebmvc.properties file)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Captcha widget&lt;/b&gt;&lt;br/&gt;AJAX validated captcha to enable human detection.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Remember me&lt;/b&gt;&lt;br/&gt;The framework will auto-login a user if so desires and will store authentication info using cookies.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Preliminary documentation&lt;/b&gt;&lt;br/&gt;A long standing due. A good percentage of the client interface is documented using the demo application.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Widgets&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;I18n Text&lt;/b&gt;&lt;br/&gt;A user can attempt to automatically translate texts into any of the supported languages using the Google AJAX Translation API&lt;/li&gt;&lt;li&gt;&lt;b&gt;Tree (Hierarchy) widget&lt;/b&gt;&lt;br/&gt;New in this version, a user can build a tree of generic nodes and modify it as wished.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Grid (Table) widget&lt;/b&gt;&lt;br/&gt;The new grid supports a contextual menu, filtering (in addition to paging and ordering), inline edition of cell data (with AJAX storage management), cell content view (for data that exceeds column width) and auto width/height&lt;/li&gt;&lt;li&gt;&lt;b&gt;Form widget&lt;/b&gt;&lt;br/&gt;Allows to check required fields before submitting and sending complete forms using JSON.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Other widgets&lt;/b&gt;&lt;br/&gt;Everything has been revamped a little or a lot.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Miscellaneous&lt;/b&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;YUI compression&lt;/b&gt;&lt;br/&gt;All JS is minified before sent (in addition to GZIP). This isn't activated by default in development environments.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Audit&lt;/b&gt;&lt;br/&gt;All create / update / delete operations are transparently audited (user, operation type, date/time, affected record, ...)&lt;/li&gt;&lt;li&gt;&lt;b&gt;RSS feeds&lt;/b&gt;&lt;br/&gt;A generic framework to obtain RSS feeds of any entity has been developed. Example feeds have been created for audit operations.&lt;/li&gt;&lt;li&gt;&lt;b&gt;DWR custom converters&lt;/b&gt;&lt;br/&gt;Working with JPA entities in JS is easier with the UUID and the Class converters.&lt;/li&gt;&lt;li&gt;&lt;b&gt;IE7/Opera support&lt;/b&gt;&lt;br/&gt;A lot of work has been invested in making IWebMvc compatible with other browsers. IE7 is fully compatible with this release (though &lt;a href="http://mail.google.com/mail/?ui=2&amp;view=js&amp;name=js&amp;ids=vsdmtnrembkr" target="new"&gt;this bug&lt;/a&gt; in dojo affects any page that contains an Editor). Opera support is preliminary but a good chunk of the code is working.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Upgraded libraries&lt;/b&gt;&lt;br/&gt;In particular, to dojo 1.1 final but Spring, Hibernate and many others as well. Important: Netbeans project files have been migrated to v6.1beta to get rid of some absolute paths and facilitate project sharing (and include sources and ...). I've just tested this release with Netbeans/Glassfish &amp; Ant/Jetty (though Eclipse/tomcat should still work fine).&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;And dozens of bug fixes and other issues. All in all, a decent work! Remember that you can download it from &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;the repository&lt;/a&gt;. Or save time by watching the (trimmed) screencast (you may need &lt;a href="http://www.techsmith.com/download/codecs.asp" target="new"&gt;this codec&lt;/a&gt;). Enjoy it!&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/267671707" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/267671707/iwebmvc-milestone-3-released.html" title="IWebMvc Milestone 3 released" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=6956388994911197993" title="4 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/6956388994911197993/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/6956388994911197993" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/6956388994911197993" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/04/iwebmvc-milestone-3-released.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-6092217908016008299</id><published>2008-03-31T09:00:00.000-07:00</published><updated>2008-04-01T07:56:28.705-07:00</updated><title type="text">IWebMvc Milestone 3 Client Features Screencast</title><content type="html">&lt;div style="text-align: justify;"&gt;I'm still in the middle of the way to Milestone 3 but I wanted to create a screencast of the features currently available so &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;here it is!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately:&lt;ul&gt;&lt;li&gt;I've tested it under VideoLan &amp;amp; QuickTime and both play the file fine. For some obscure reason WMP fails to do it.&lt;/li&gt;&lt;li&gt;Google Code just allows files up to 20MB so I had to remove the later parts (searching, auditing, other widgets) and compress it further&lt;/li&gt;&lt;li&gt;It just covers the client side (won't see any code)&lt;/li&gt;&lt;/ul&gt;But, all in all, it's a good showcase of what IWebMvc offers out-of-the-box to any developer. In the near future, I'll try to create a new one showing the development process, probably explaining how to create a new domain entity and getting CRUD operations running.&lt;br /&gt;&lt;br /&gt;And remember, some of those features (security, documentation, widget enhancements...) are exclusive of Milestone 3 so they won't be publicly available for a while (I reckon a week or so yet). But you can always get the latest SVN revision if you want to test them today.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/261448347" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/261448347/iwebmvc-milestone-3-client-features.html" title="IWebMvc Milestone 3 Client Features Screencast" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=6092217908016008299" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/6092217908016008299/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/6092217908016008299" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/6092217908016008299" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/03/iwebmvc-milestone-3-client-features.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-2427648753304342784</id><published>2008-03-21T06:08:00.000-07:00</published><updated>2008-03-22T04:02:25.767-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><title type="text">IWebMvc M2 available: Lots of goodies</title><content type="html">&lt;div style="text-align: justify;"&gt;It's been less than a month since the preview release of IWebMvc but a lot of things have been added to the platform and I thought it was a good moment to release a new version. I will label it as Milestone 2. In case that you didn't try the first one I've created a short presentation of the framework possibilities. It's the fastest way to get your feet wet with IWebMvc and an interesting reading nonetheless. You can obtain it from &lt;a href="http://code.google.com/p/internna/downloads" target="new"&gt;the project download page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And to the topic! This new version packs lots of new functionalities so I'm going to just list them and provide some info (remember that the best way to understand everything is downloading and checking for yourself!):&lt;ul&gt;&lt;li&gt;&lt;b&gt;Environment features&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Additional supported configurations&lt;/b&gt;&lt;br/&gt;In addition to embedded Jetty, IWebMvc can now be run in Tomcat and/or Glassfish (or any other JEE5 compliant AS really). IWebMvc will autodetect the deployment server and apply some custom configuration.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Per server configuration&lt;/b&gt;&lt;br/&gt;IWebMvc transaction management can be configured in pretty much any way you like. It offers examples to be easily deployed in different environments: Database pools, full JTA, Spring JPA, driver manager connections, JOTM, with or without JNDI, ...&lt;/li&gt;&lt;li&gt;&lt;b&gt;IDE integration&lt;/b&gt;&lt;br/&gt;This version provides Netbeans 6 / Eclipse Europa project files for easy workspace setup.&lt;/li&gt;&lt;li&gt;&lt;b&gt;MySQL support&lt;/b&gt;&lt;br/&gt;IWebMvc will accept MySQL (in addition to HSQLDB) as database back end.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Installation guide&lt;/b&gt;&lt;br/&gt;In addition to Jetty demo, IWebMvc includes now complete installation instructions to run it in the several supported configurations.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Cache &amp;amp; compression filters&lt;/b&gt;&lt;br/&gt;All content served will include HTTP cache headers and will be compressed using gzip, improving performance and saving bandwidth.&lt;/li&gt;&lt;li&gt;&lt;b&gt;IE 7 preliminary support&lt;/b&gt;&lt;br/&gt;There are still minor glitches (mainly with file management) but 90% of the features already work.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Hibernate features&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Full Text Search&lt;/b&gt;&lt;br/&gt;In addition to filters, IWebMvc can look up entities searching in all indexed fields.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Completely revamped Filter functionality&lt;/b&gt;&lt;br/&gt;Easier to include and more powerful.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Support for lazy initialized collections&lt;/b&gt;&lt;br/&gt;Views can wok with uninitialized collections transparently.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;DWR features&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Classpath scanning&lt;/b&gt;&lt;br/&gt;DWR will scan the classpath looking for suitable beans (those annotated with @RemoteProxy) and create automatic proxies for them.&lt;/li&gt;&lt;li&gt;&lt;b&gt;New DWR read store&lt;/b&gt;&lt;br/&gt;Built from scratch dojo data read store. Tested support for FilteringSelect and/or Grid widgets.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;dojo features&lt;/b&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Upgraded to version 1.1 beta 3&lt;/b&gt;&lt;br/&gt;All client code has been migrated to the latest available developing version of dojo (final release of 1.1 expected this month).&lt;/li&gt;&lt;li&gt;&lt;b&gt;Theme support&lt;/b&gt;&lt;br/&gt;User can change the appearance at any time. All three (Soria, Tundra, Nihilo) themes from dojo are available. Custom themes can be added with little effort.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Entity Locator widget&lt;/b&gt;&lt;br/&gt;Domain entities can be binded using a powerful search widget (in addition to preexistent combobox widget).&lt;/li&gt;&lt;li&gt;&lt;b&gt;Video widget&lt;/b&gt;&lt;br/&gt;New video component supporting Flash (.flv) archives&lt;/li&gt;&lt;li&gt;&lt;b&gt;Thumbnail widget&lt;/b&gt;&lt;br/&gt;Server side on the fly creation of thumbnails for any image.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Grid widget&lt;/b&gt;&lt;br/&gt;In addition to PagingGrid, classical dojo grids are now available&lt;/li&gt;&lt;li&gt;&lt;b&gt;List widget&lt;/b&gt;&lt;br/&gt;Any List&amp;lt;DomainEntity&amp;gt; can be created / updated transparently. All binding and validation is automatic as well. A specific tag wrapper and client component have also been created. Other collection widgets can be easily derived from this one.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Refactored client code&lt;/b&gt;&lt;br/&gt;Most of JS code has been refactored out of the widgets to a common file to improve performance and maintainability.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;In fact, there are more features present but I'll left them undescribed for now. Of course, this version packs dozens of bug fixes as well. But better see it by yourself! So I have to encourage everybody to go to the &lt;a href="http://code.google.com/p/internna/downloads/list"&gt;dowload page&lt;/a&gt; and give it a try. Or by checking out the latest sources (svn export http://internna.googlecode.com/svn/trunk/IWebMvc IWebMvc). As always comments, suggestions, contributions, requests are very welcomed using the &lt;a href="http://groups.google.com/group/internna"&gt;mailing list&lt;/a&gt;. And expect many more new features coming soon :-)&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/256013582" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/256013582/iwebmvc-m2-available-lots-of-goodies.html" title="IWebMvc M2 available: Lots of goodies" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=2427648753304342784" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/2427648753304342784/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/2427648753304342784" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/2427648753304342784" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/03/iwebmvc-m2-available-lots-of-goodies.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-3886518068327809890</id><published>2008-03-03T03:42:00.001-08:00</published><updated>2008-03-04T07:07:07.229-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="IWebMvc" /><category scheme="http://www.blogger.com/atom/ns#" term="release" /><category scheme="http://www.blogger.com/atom/ns#" term="preview" /><title type="text">IWebMvc first preview version available!</title><content type="html">&lt;div style="text-align: justify;"&gt;The landscape of web frameworks based on Java is crowded. For the most part, they are all flexible and capable and you're better served using them than trying to build something by your own. At the bare minimum you are saving time. The price to pay is the learning curve. And sometimes is steep! Let's take &lt;a href="http://www.springframework.org" target="new"&gt;Spring&lt;/a&gt;, for example. The basics, the IoC container, is easy to learn and leverage but add now, AOP, transaction management, MVC, security and/or ORM capabilities. Things can get complex really soon.&lt;br /&gt;&lt;br /&gt;Unfortunately, even if you happen to master all those topics, a new issue will rise his ugly face. It happens because even the best frameworks just target some clearly defined development areas, for example, Hibernate targets database abstraction. This means any developer is forced to include a variable number of libraries and integrate them as best as he can. Being a committer of &lt;a href="http://www.getahead.org/dwr" target="new"&gt;DWR&lt;/a&gt; (currently responsible of the Spring integration) I, for sure, know first hand what this means. In short, troubles.&lt;br /&gt;&lt;br /&gt;Some Open Source frameworks have come to the rescue. AppFuse will let you kick start a project using a different combinations of frameworks quickly. Grails is another great web platform, the scaffolding features are fantastic (automatic controllers and views!) but it's based on Groovy.&lt;br /&gt;&lt;br /&gt;Nonetheless, in my mind what I really needed was a platform that:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Is based on Java&lt;/b&gt;&lt;br/&gt;Although supporting Grooy / JRuby is a plus&lt;/li&gt;&lt;li&gt;&lt;b&gt;Helps me to kick start a project&lt;/b&gt;&lt;br/&gt;But simplifying the process by giving me the best (and this can be tricky) set of frameworks for each task&lt;/li&gt;&lt;li&gt;&lt;b&gt;Integrates both server and client sides&lt;/b&gt;&lt;br/&gt;And it's lightweight, robust and extensible. Read &lt;i&gt;enterprise quality&lt;/i&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Supports all the common tasks a web app has to handle&lt;/b&gt;&lt;br/&gt;I include here: User Management, CRUD operations, i18n support (both framework &amp; data), AJAX and astounding visuals&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;In the end there was nothing in the wild that could help me. In part because my framework choices are pretty clear (and fixed): JEE5/Spring/Hibernate/DWR/dojo. I have a number of projects on my back (heck! 10 years!) and these tools have helped me (like no others) to achieve robustness, productivity and quality.&lt;br /&gt;&lt;br /&gt;So at the beginning of the year I embarked a personal task. I would build a web framework (yet another!), filling the void that existed, and release it as Open Source. I knew I had the knowledge (picking ideas from each successful project I've been in) and it was a matter of effort.&lt;br /&gt;&lt;br /&gt;I'm glad to be able to release the first alpha (preview) version today! Here's the list of features I could manage to get working during the time:&lt;ul&gt;&lt;li&gt;Environment&lt;ul&gt;&lt;li&gt;Fully configured project&lt;/li&gt;&lt;li&gt;&lt;a href="http://ant.apache.org" target="new"&gt;Ant&lt;/a&gt; + &lt;a href="http://ant.apache.org/ivy/" target="new"&gt;Ivy&lt;/a&gt; working build scripts&lt;ul&gt;&lt;li&gt;Transitive dependency management&lt;/li&gt;&lt;li&gt;Quality assurance tools and reports&lt;/li&gt;&lt;li&gt;Platform independent&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Server and database independent&lt;ul&gt;&lt;li&gt;Tested against Glassfish v2 and Jetty&lt;/li&gt;&lt;li&gt;Tested against MySQL and HSQLDB&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Spring&lt;ul&gt;&lt;li&gt;AOP, Context, MVC, ORM, TX pre-configured&lt;/li&gt;&lt;li&gt;Root (parent) &amp;amp; per web application contexts&lt;/li&gt;&lt;li&gt;Incredibly reduced XML configuration&lt;ul&gt;&lt;li&gt;Convention over configurarion&lt;/li&gt;&lt;li&gt;Annotation based configuration&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Locale support (English, Spanish)&lt;/li&gt;&lt;li&gt;Powerful but easy validation framework&lt;ul&gt;&lt;li&gt;Injected in Controllers&lt;/li&gt;&lt;li&gt;Remote use with AJAX&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Repository abstraction&lt;ul&gt;&lt;li&gt;Implementation based on HDD (more following)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;JPA / Hibernate&lt;ul&gt;&lt;li&gt;Annotation based&lt;/li&gt;&lt;li&gt;Automatic DB schema creation &amp;amp; update&lt;/li&gt;&lt;li&gt;Base domain model provided&lt;/li&gt;&lt;li&gt;JTA&lt;/li&gt;&lt;li&gt;Generic DAO implementation&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;DWR&lt;ul&gt;&lt;li&gt;Advanced use of converters &amp;amp; javascript&lt;ul&gt;&lt;li&gt;Mapped domain objects allow transparent work in the browser&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;File upload with progress bar&lt;/li&gt;&lt;li&gt;Leverages upcoming 3.0 functionalities&lt;ul&gt;&lt;li&gt;Not yet available in any other framework&lt;/li&gt;&lt;li&gt;Remote beans using annotations&lt;/li&gt;&lt;li&gt;File transfers&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;dojo&lt;ul&gt;&lt;li&gt;Wrapped dojo widgets inside tag files&lt;ul&gt;&lt;li&gt;Centralized access&lt;/li&gt;&lt;li&gt;Auto-configured&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;DWR integration&lt;ul&gt;&lt;li&gt;Including a DWR read store to populate content&lt;/li&gt;&lt;li&gt;Automatic remote validation added&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Widgets&lt;ul&gt;&lt;li&gt;Provided backing beans in the server for each widget&lt;ul&gt;&lt;li&gt;Automatic binding and validation&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Included in this release&lt;ul&gt;&lt;li&gt;Textbox family (text, number, date, checkbox)&lt;/li&gt;&lt;li&gt;I18n text&lt;/li&gt;&lt;li&gt;Rich text editor&lt;/li&gt;&lt;li&gt;Document upload&lt;/li&gt;&lt;li&gt;Image upload&lt;/li&gt;&lt;li&gt;Entity grid (including pagination, ordering &amp;amp; AJAX backing model)&lt;/li&gt;&lt;li&gt;Filter (includes filter groups and ranges)&lt;/li&gt;&lt;li&gt;Menu bar&lt;/li&gt;&lt;li&gt;Entity selector (using a combo)&lt;/li&gt;&lt;li&gt;Color chooser&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;CRUD&lt;ul&gt;&lt;li&gt;Automatic CRUDs for any domain entityt&lt;/li&gt;&lt;li&gt;Default or customized views&lt;/li&gt;&lt;li&gt;Build domain classes using Lego pieces&lt;ul&gt;&lt;li&gt;Automatic DB mappings&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Miscellaneous&lt;ul&gt;&lt;li&gt;3DES Encryption&lt;/li&gt;&lt;li&gt;Utility classes&lt;/li&gt;&lt;li&gt;Little demo application&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;Not bad for a months work :-)&lt;br /&gt;&lt;br /&gt;If you wanna try it (and I really hope so!) here are the installation instructions. Just a little disclaimer before: This is a preview (alpha status) release. It has many glitches (Firefox is in fact recommended). It's main goal is to offer a vision of where the framework is heading (it lacks several important features like security, documentation, theme support...). In addition I really wanted to make this release today so I rushed a little and couldn't fix some tests (don't worry about that). So, finally, the promised instructions, enjoy it:&lt;ul&gt;&lt;li&gt;Requirements&lt;ul&gt;&lt;li&gt;Installed JDK 6&lt;/li&gt;&lt;li&gt;Subversion client (if checking the sources)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Download&lt;ul&gt;&lt;li&gt;From HTTP: &lt;a href="http://code.google.com/p/internna/downloads/list" target="new"&gt;Download from repository&lt;/a&gt;&lt;/li&gt;&lt;li&gt;From subversion:&lt;br/&gt;&lt;code&gt;svn checkout -r 72 https://internna.googlecode.com/svn/trunk/IWebMvc IWebMvc&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Double click the provided run.bat file&lt;/li&gt;&lt;li&gt;Point your browser to http://localhost:8080/iwebmvc&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now, the real value of the platform can be seen creating a new domain class (like those in the demoapp.domain package) and getting for free the CRUD operations, the screens and the DB schema. And building the model class should be fairly easy using the provided backing beans (I18nText, RichText, Document, Image, ...).&lt;br /&gt;&lt;br /&gt;For any questions (comments, contributions, recommendations, doubts...) related to IWebMvc please refer them to the &lt;a href="http://groups.google.com/group/internna"&gt;mailing list&lt;/a&gt;.&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/244872644" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/244872644/iwebmvc-first-preview-version-available.html" title="IWebMvc first preview version available!" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=3886518068327809890" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/3886518068327809890/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3886518068327809890" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3886518068327809890" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/03/iwebmvc-first-preview-version-available.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-75769217400724662</id><published>2008-02-13T10:39:00.000-08:00</published><updated>2008-02-13T11:09:24.468-08:00</updated><title type="text">DWR 3.0 &amp; Spring: A quick preview</title><content type="html">&lt;div style="text-align: justify;"&gt;With &lt;a href="http://www.directwebremoting.com" target="new"&gt;DWR&lt;/a&gt; 3 around the corner (the first milestone is available right now) is time to have a look at the new features it brings to the table. In fact, it packs so many, that I'm going to talk just about those related to Spring.&lt;br /&gt;&lt;br /&gt;As you know (or should :-), by now DWR has a nice integration with Spring and specially Spring MVC, thanks to the custom namespace it provides. Nonetheless the team has make an effort to improve it. And the results are astounding! Let's review the new features:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Remoting beans from a parent (root) context&lt;/b&gt;&lt;br/&gt;Until now, when using &amp;lt;dwr:controller&amp;gt; just the beans in the same context where proxied. From now on, the root context can define candidate beans as well.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;New defaults&lt;/b&gt;&lt;br/&gt;DWR will offer default names for your controller and remoted beans. In the former case the bean will be called dwrController. In the later, the bean will be available in your client code with the same name as the bean, capitalized. So &lt;i&gt;&amp;lt;bean id="sample" class="..."&amp;gt;&lt;/i&gt; will be remoted as Sample.js&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Explicitly setting an application context&lt;/b&gt;&lt;br/&gt;As of now, the default web application context was always used. The new version allows a developer to set a specific application context in the DWR Spring servlet. DWR will scan this context looking for candidate beans.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Namespace support improved&lt;/b&gt;&lt;br/&gt;Release 3 will add the &amp;lt;dwr:url-mapping /&amp;gt; tag. If declared in your XML (along with a &amp;lt;dwr:controller /&amp;gt;) all the needed mappings will be automatically created and handled.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Configure everything using annotations&lt;/b&gt;&lt;br/&gt;Spring beans annotated with @RemoteProxy and @RemoteMethod will be automatically proxied and available in the browser. To activate this feature a new &amp;lt;dwr:annotation-config /&amp;gt; tag has been developed. Just one caveat, this kind of configuration does not work for advised / scoped proxies for the time being. You have to revert to the common &amp;ltdwr:remote /&amp;gt; and &amp;lt;aop:scoped-proxy /&amp;gt; in that case.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Classpath scanning&lt;/b&gt;&lt;br/&gt;DWR will scan the classpath looking for classes annotated with @RemoteProxy and create the bean definitions directly (so you can ommit the @Component annotation). A new &amp;lt;dwr:component-scan/&amp;gt; tag has been created for it. A side note here, the code is not yet available (it's not in the milestone) because it requires Spring 2.5.2+ which has not been publicly released yet.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;&lt;b&gt;Several other minor changes and bug fixes&lt;/b&gt;&lt;br/&gt;A lot of work behind the scenes. For example, a bean name can now be preceded by a slash so it's automatically mapped.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;All in all, a lot of good work. And the best of all, it's just the beginning! Other areas, like file handling or reverse AJAX, pack even more interesting features. I can only recommend that you &lt;a href="https://dwr.dev.java.net/servlets/ProjectDocumentList?folderID=8738" target="new"&gt;give it a try&lt;/a&gt; today.&lt;br /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/234544160" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/234544160/dwr-30-spring-quick-preview.html" title="DWR 3.0 &amp; Spring: A quick preview" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=75769217400724662" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/75769217400724662/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/75769217400724662" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/75769217400724662" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/02/dwr-30-spring-quick-preview.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-3386910161763151568</id><published>2008-01-29T04:49:00.000-08:00</published><updated>2008-01-29T07:32:15.379-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Scala" /><category scheme="http://www.blogger.com/atom/ns#" term="Ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="Dynamic Languages" /><category scheme="http://www.blogger.com/atom/ns#" term="Groovy" /><title type="text">Choosing a dynamic language to learn (Ruby/Groovy/Scala)</title><content type="html">&lt;div style="text-align: justify;"&gt;I've had &lt;a href="http://www.ruby-lang.org" target="new"&gt;Ruby&lt;/a&gt; sitting in my &lt;a href="http://www.tadalist.com/" target="new"&gt;ToDo list&lt;/a&gt; for far too long. I mean, at least for a couple of years! It's been so long that in the time some fellows have made into the list as well, namely &lt;a href="http://groovy.codehaus.org/" target="new"&gt;Groovy&lt;/a&gt; and &lt;a href="http://www.scala-lang.org" target="new"&gt;Scala&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Finally, this year, I've decided that the time has come and that I have to invest some effort. Unfortunately, I know have to decide where.&lt;br /&gt;&lt;br /&gt;I will start saying that all three candidates share the basic functionality that I'm looking for:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Scripting&lt;/b&gt;&lt;br/&gt;I want an interpreted language that saves me time to come up with quick prototypes and hacks. I want a powerful OS tool beyond shell scripts. I may need to compile to bytecode later as well.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Elegance and expressiveness&lt;/b&gt;&lt;br/&gt;I want to avoid boilerplate. I need dynamic typing and runtime inference. I want syntax sugar! I want easy to read DSLs.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Closures&lt;/b&gt;&lt;br/&gt;They are a must. My only concern is readability but beyond that I cannot understand why Java does not have them yet.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Mixins&lt;/b&gt;&lt;br/&gt;Inheritance on steroids.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Go Functional&lt;/b&gt;&lt;br/&gt;Try to combine imperative style with some characteristics natural to functional programming. Less what and more how (descriptive style).&lt;/li&gt;&lt;/ul&gt;In the end, I want to be productive and those are the minimal requirements (nowadays). Beyond that, it's a matter of taste. Here's a little list of pros and cons of each. Take it with a grain of salt, this list is based on my personal preferences, many points will not be worth something to anyone but me:&lt;ul&gt;&lt;li&gt;&lt;b&gt;Ruby&lt;/b&gt;&lt;br/&gt;The first of the crop and the most popular for sure.&lt;ul&gt;&lt;li&gt;Pros&lt;ul&gt;&lt;li&gt;Refreshing (depart from C syntax)&lt;/li&gt;&lt;li&gt;Rails&lt;/li&gt;&lt;li&gt;Mature (since 1995)&lt;/li&gt;&lt;li&gt;Community&lt;/li&gt;&lt;li&gt;JRuby / SUN involvement (leverage the Java platform)&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Cons&lt;ul&gt;&lt;li&gt;Too much hype&lt;/li&gt;&lt;li&gt;Lacks "enterprise" consideration (Threading? Scaling?)&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Return_on_Investment" target="new"&gt;Low ROI&lt;/a&gt; (&lt;a href="http://www.theserverside.com/news/thread.tss?thread_id=48253" target="new"&gt;see market penetration&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Is it loosing momentum?&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Groovy&lt;/b&gt;&lt;br/&gt;Enterprise capabilities along with cool productivity features&lt;ul&gt;&lt;li&gt;Pros&lt;ul&gt;&lt;li&gt;Tight Java / JVM integration&lt;/li&gt;&lt;li&gt;Extends JDK API(&lt;a href="http://groovy.codehaus.org/groovy-jdk/" target="new"&gt;GDK&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;Easyness / Learning curve&lt;/li&gt;&lt;li&gt;Out-of-the-box &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/dynamic-language.html" target="new"&gt;Spring integration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Grails&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Cons&lt;ul&gt;&lt;li&gt;Performance&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Scala&lt;/b&gt;&lt;br/&gt;A general purpose (multi-paradigm) programming language&lt;ul&gt;&lt;li&gt;Pros&lt;ul&gt;&lt;li&gt;Interoperability with Java&lt;/li&gt;&lt;li&gt;Language features not retrofitted (ie Genericity)&lt;/li&gt;&lt;li&gt;Actors, concurrency and distributed programming&lt;/li&gt;&lt;li&gt;Implicit enrichment of a Java class&lt;/li&gt;&lt;li&gt;Statically typed with inference&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Cons&lt;ul&gt;&lt;li&gt;Tooling&lt;/li&gt;&lt;li&gt;Not mainstream yet&lt;/li&gt;&lt;li&gt;Smaller community&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;In the end, I've chosen Groovy. I'm a geek, true. But I'm also a lazy developer and I like to apply my knowledge on day-by-day basis. For me that's easier in the Java camp (ie. with Spring).&lt;br /&gt;&lt;br /&gt;I could choose JRuby then, but I'm  not sure that's the correct path even though Sun's commitment (for example, with Netbeans and the compiler) seems pretty heavy.&lt;br /&gt;&lt;br /&gt;Scala could be. Indeed it's improving (as the others) but it's not there yet. In the end, Scala seems more like a (future) Java replacement and that's not what I'm looking for right now.&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/225301077" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/225301077/choosing-dynamic-language-to-learn.html" title="Choosing a dynamic language to learn (Ruby/Groovy/Scala)" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=3386910161763151568" title="7 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/3386910161763151568/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3386910161763151568" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/3386910161763151568" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/01/choosing-dynamic-language-to-learn.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-7628039940270175233</id><published>2008-01-21T03:33:00.000-08:00</published><updated>2008-01-21T05:08:27.479-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Spring MVC DWR" /><title type="text">A little bit more DWR and Spring MVC</title><content type="html">&lt;div style="border:1px solid gray;padding-right:2px;padding-left:3px;padding-top:5px;padding-bottom:5px;font-family: courier new;font-size:12px;background-color:lightgray;width:88%;"&gt;I've blogged before about &lt;a href="http://internna.blogspot.com/2007/05/integrating-dwr-spring.html"&gt;integrating Spring and DWR&lt;/a&gt;. This is just an update (though interesting) with some clarifications due to a request in the &lt;a href="http://getahead.org/dwr/support" target="new"&gt;DWR mailing list&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Each new version of the &lt;a href="http://www.springframework.org/" target="new"&gt;Spring framework&lt;/a&gt; adds flexibility mainly by adding new features. This, in turn, can mean added complexity even though the additions are well thought and easy to apply. The complexity comes with the mix and match. In some way, it's like Java itself, it's not the added complexity of a new language feature, it's the integration with the rest of the language and the corner cases that appear. This is commonly a consequence of backward compatibility and the absence of deprecation.&lt;br /&gt;&lt;br /&gt;Spring MVC 2.x has included new implementations of the classical &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/mvc/Controller.html" target="new"&gt;Controller&lt;/a&gt; interface. Along with them new view resolvers and mappings were developed. These new controllers provide a new way of getting things done, for example, using annotations, but were designed to work side by side with the rest of the framework. This can lead to some confusion, easily, when some controllers are instantiated using component scan, others are declared in XML, some are mapped by annotations, others using convention over configuration and the views are injected or resolved by name and/or URL. Add DWR to the mix and things get scary for the less experienced developers.&lt;br /&gt;&lt;br /&gt;I will start with an advice, do not mix different technologies if at all possible. This will force you to choose a path and commit to it but it will pay benefits in the long run. Less is more.&lt;br /&gt;&lt;br /&gt;So what options are available? I will list the ones I consider the more intuitive. There are more combinations possible and even more options that I won't list (for example, declare the URL as the bean id).&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Use XML to explicitly declare beans and &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/handler/SimpleUrlHandlerMapping.html" target="new"&gt;mappings&lt;/a&gt;&lt;/b&gt;&lt;br/&gt;As always have been made. It's simple and expressive. Views can be handled by a &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/view/InternalResourceViewResolver.html" target="new"&gt;InternalResourceViewResolver&lt;/a&gt;. The schema is highly integrated so DWR just becomes a couple of added lines in the related beans. The bad news, the unneeded boilerplate.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Convention over configuration&lt;/b&gt;&lt;br/&gt;Use &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.html" target="new"&gt;ControllerClassNameHandlerMapping&lt;/a&gt; and &lt;a href="http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.html" target="new"&gt;DefaultRequestToViewNameTranslator&lt;/a&gt;. Declare your beans in XML. Add a specific mapper for DWR at the end of the chain (order = 2).&lt;/li&gt;&lt;li&gt;&lt;b&gt;Annotations all the way&lt;/b&gt;&lt;br/&gt;They're concise and powerful because they're attached to the element. Do not mix with XML or get ready for the mandatory pandemonium that you have started. By the way, HandlerMappings are usually easier than HandlerAdapters. Unfortunately, currently DWR annotations are not tightly integrated (something to improve) so you need to fall back to the provided schema which seems counterintuitive.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;And that's pretty much it. As I know that some people will still reject the advice and throw everything together, I have prepared a little sample project. It features four different controllers, three different mappings and a couple of view resolvers in addition to a DWR remoted bean. It's available &lt;a href="http://internna.googlecode.com/files/dwr-spring-2.5.zip" target="new"&gt;here&lt;/a&gt;. Hope it helps.&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/220369765" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/220369765/little-bit-more-dwr-and-spring-mvc.html" title="A little bit more DWR and Spring MVC" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=7628039940270175233" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/7628039940270175233/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7628039940270175233" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7628039940270175233" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/01/little-bit-more-dwr-and-spring-mvc.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-591664852077510001</id><published>2008-01-14T04:50:00.000-08:00</published><updated>2008-01-14T10:33:40.601-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java accessors law demeter" /><title type="text">The evilness of accessors</title><content type="html">&lt;div style="text-align: justify;"&gt;There are things in life that you take for granted. That is, you are so accustomed to them that you never question them. What for? Accessors (member functions that directly manipulate the value of fields) in the Java world is one of them.&lt;br /&gt;&lt;br /&gt;The use of getters and setters is one of the first lessons to learn when working with Java, probably because the JavaBeans specification mandates their use. They help to increase robustness, enforce logic and hide implementation details. What's not to love? Well, something.. but maybe Java 7 will finally bring us properties...&lt;br /&gt;&lt;br /&gt;During the weekend I read an interesting article titled &lt;a href="http://www.dzone.com/links/rss/dishonest_programming.html" target="new"&gt;Dishonest Programming&lt;/a&gt;. I'll quote one of the paragraphs:&lt;br /&gt;&lt;blockquote&gt;Don't write a public accessor to a private member and tell me that member is still private. If an object is completely and utterly accessible from anywhere in the application, it's a global variable.&lt;/blockquote&gt;&lt;br /&gt;Everything was related to the following line of code (a line I've written a handful of times...):&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;setupModel.getOverrides().add(accountOverride);&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Or a subtle variant:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;for(Bean b: a.getBeans()) b.doC();&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The &lt;a href="http://en.wikipedia.org/wiki/Law_of_Demeter" target="new"&gt;Law of Demeter&lt;/a&gt; (Principle of Least Knowledge) clearly states that a method M of an object O may only invoke the methods of the following kinds of objects&lt;ul&gt;&lt;li&gt;O itself&lt;/li&gt;&lt;li&gt;M's parameters&lt;/li&gt;&lt;li&gt;Any objects created/instantiated within M&lt;/li&gt;&lt;li&gt;O's direct component objects&lt;/li&gt;&lt;/ul&gt;Right there I was puzzled. The principle seemed correct but its implications were awful! Imagine this class:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color:lightgray;"&gt;public class company {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private List&amp;lt;Address&gt; addresses;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Set&amp;lt;Account&gt; accounts;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;private Map&amp;lt;Long, Employee&gt; employees;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Can you determine the number of methods to add to the interface if you pretend to comply with the LoD? At least a couple of dozens for the collections (just &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html" target="new"&gt;java.util.List&lt;/a&gt; packs thirty approximately) and some more for the types.. On the other hand, the reasons exposed by the author (&lt;a href="http://chalain.livejournal.com/63878.html" target="new"&gt;here&lt;/a&gt;) seemed valid:&lt;ul&gt;&lt;li&gt;Violate encapsulation&lt;/li&gt;&lt;li&gt;Tightly couple all three objects together&lt;/li&gt;&lt;li&gt;Cripple modularity/type independence&lt;/li&gt;&lt;li&gt;Deprive the parent class of the ability to guard, or even be aware of, the child data&lt;/li&gt;&lt;/ul&gt;First of all, as an architect I tend to agree with those reasons.&lt;br /&gt;&lt;br /&gt;The first one is problematic though. Aren't public getters already breaking encapsulation? The moment they're available any other object can really interact with the supposedly &lt;i&gt;private&lt;/i&gt; fields.&lt;br /&gt;&lt;br /&gt;The second worries me greatly! This kind of code glues together objects that shouldn't be tied.&lt;br /&gt;&lt;br /&gt;The fourth is problematic as well. &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/beans/PropertyChangeListener.html" target="new"&gt;PropertyChangeListeners&lt;/a&gt; already exist in Java but they're meant for peer-to-peer interactions not for parent/child invocations. If you're bypassing the object this way it's probably better to refactor.&lt;br /&gt;&lt;br /&gt;At this stage, we have a problem. If the internal structure of an object is available (and so do the getters) it's difficult to avoid using it (or telling a programmer to avoid using it, if you prefer). I've come to the conclusion that creating proxy methods for cascade operations is the way to go, even if they are a lot!&lt;br /&gt;&lt;br /&gt;There are two options then:&lt;ul&gt;&lt;li&gt;Defaulting to a &lt;i&gt;protected&lt;/i&gt; visibility&lt;/li&gt;&lt;li&gt;Returning immutable objects&lt;/li&gt;&lt;/ul&gt;Both have pros ans cons. The first one may not work at all if the rest of the architecture expects public getters (some ORM frameworks or the EL in a JSP do, for example). The second one can be (somehow) confusing, tedious to implement for beans (for &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html" target="new"&gt;Collections&lt;/a&gt; is already done) and (depending on the implementation) even penalize the overall performance.&lt;br /&gt;&lt;br /&gt;Finally, and I agree with the original author here, everything is a trade off and nothing should be written in stone. Just don't abuse the delegate strategy and try to conform to a best practice. We all know Java is verbose to the extreme and that this solution adds even more boilerplate (and that in 90% of the cases it won't matter) but if you stick to Java that's a nasty side effect you have to bear with. Just don't try to create shortcuts that punish good design.&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/216480177" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/216480177/evilness-of-accessors.html" title="The evilness of accessors" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=591664852077510001" title="2 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/591664852077510001/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/591664852077510001" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/591664852077510001" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/01/evilness-of-accessors.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-7913015198567608129</id><published>2008-01-05T13:00:00.000-08:00</published><updated>2008-01-05T04:08:28.668-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="spring boilerplate convention configuration annotations" /><title type="text">Squashing boilerplate in Spring</title><content type="html">&lt;div style="text-align: justify;"&gt;Nobody can deny that the advent of IoC/DI frameworks, ORM tools and Web Services has brought robustness to the enterprise world. Programs are  more clear and concise than ever before, at the cost of moving configuration from the source code to a specific realm, usually based on XML files. This, by itself, is not bad at all. In fact, is a Good Thing. Problems appear when the configuration is a language itself and grows so much that can be compared in size to the source code.&lt;br /&gt;&lt;br /&gt;Here's a little guide that will help you to minimize the amount of config needed in a project&lt;ul&gt;&lt;li&gt;&lt;b&gt;Annotations are your friend!&lt;/b&gt;&lt;br/&gt;Easy one. From a dubious start, annotations are now considered a first class citizen. Even Spring developers encourage their use now. If you are using Java5+ try to move as much XML to annotations. It will help you in two ways: less code is needed and configuration is attached to the component directly (which makes reading code easier).&lt;br /&gt;&lt;br /&gt;In Hibernate/JPA nearly everything can be expressed with an annotation. Spring now offers annotations for bean creation(@Component...), managing life cycles(@PostConstruct...), wiring dependencies (@Resource...) and security (@Secured...). The MVC framework (in 2.5) also packs some more to help with controllers (@Controller...) and method and parameter mappings(@RequestMapping...).&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Leverage the latest version&lt;/b&gt;&lt;br/&gt;One of the areas that has evolved more positively from Spring 1.x, without doubt, is writing configuration XML. The second release of Spring brought a lot of syntax sugar in the form of &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/xsd-config.html" target="new"&gt;additional schemes&lt;/a&gt;(jee, util,...) and simplified the dependency declaration. Spring 2.5 has brought the &lt;i&gt;p&lt;/i&gt; namespace and component scanning. And above all, not only is XML configuration easier to write, it is now also &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/extensible-xml.html" target="new"&gt;extensible&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Autowire&lt;/b&gt;&lt;br/&gt;Autowire has always been available and has been discouraged with passion as well. Detractors will tell you to skip the magic that happens behind the curtain. I cannot agree more. It was a common point of failure. And one difficult to debug.&lt;br /&gt;&lt;br /&gt;Nonetheless, the situation now has changed a little. The @Autowired annotation is already quite clear and it can be used in conjunction with @Qualifier to improve the understanding. I wouldn't autowire everything, don't get me wrong, but how many times do you have an interface with just a default implementation? Not all your beans can be candidate to be replaced by another strategy, do they?&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Convention over configuration&lt;/b&gt;&lt;br/&gt;A mantra for RoR developers. Probably they embraced it after writing some code in Java! Basically, avoid configuring something if there's a suitable default value already. And stick to defaults as much as possible. Maven does it for example, keep the standard directory structure and Maven can work with pretty little configuration overhead.&lt;br /&gt;&lt;br /&gt;Spring has always favored this kind of development as well. But in &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-coc" target="new"&gt;2.x MVC&lt;/a&gt; new additions encourage it further(it's called sensible defaulting): &lt;a href="http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/mvc/support/ControllerClassNameHandlerMapping.html" target="new"&gt;ControllerClassNameHandlerMapping&lt;/a&gt; and &lt;a href="http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/web/servlet/view/DefaultRequestToViewNameTranslator.html" target="new"&gt;DefaultRequestToViewNameTranslator&lt;/a&gt;. In case you haven't used them yet, they allow the dispatcher servlet to select a handler based on the class name of the controller and equally forward the result to a view. For example, &lt;i&gt;IndexController&lt;/i&gt; and &lt;i&gt;index.jsp&lt;/i&gt; would be invoked for &lt;i&gt;http://.../index.htm&lt;/i&gt; without any configuration explicitly written.&lt;br /&gt;&lt;br /&gt;Of course, beware that there's again a lot of magic behind the curtain. At least document it somewhere (the project &lt;a href="http://trac.edgewall.org" target="new"&gt;wiki&lt;/a&gt; comes to my mind). It won't cause you any troubles though (if you're not pushing the edges..), the controller and the view will be invoked or not&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Create a root application context&lt;/b&gt;&lt;br/&gt;Beans can be inherited from a parent application context in Spring. This means that any shared beans should be refactored there and later be referenced from any other context. Beans can be shared between web applications, EJBs and the like. More info is available &lt;a href="http://internna.blogspot.com/2007/05/sharing-global-spring-application.html" target="new"&gt;here&lt;/a&gt;. Remember that Spring 2.5 offers the possibility of deploying application contexts as a &lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/cci.html" target="new"&gt;JCA adapter&lt;/a&gt; for headless applications.&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Create abstract beans&lt;/b&gt;&lt;br/&gt;Probably you're already using abstract classes to encapsultae common functinality. Are you doing the same for beans? I'll copy &lt;a href="http://static.springframework.org/spring/docs/1.2.x/reference/beans.html#beans-child-bean-definitions" target="new"&gt;Spring documentation&lt;/a&gt; here: &lt;blockquote&gt;A bean definition potentially contains a large amount of configuration information, including container specific information (i.e. initialization method, static factory method name, etc.) and constructor arguments and property values. A child bean definition is a bean definition which inherits configuration data from a parent definition. It is then able to override some values, or add others, as needed. Using parent and child bean definitions can potentially save a lot of typing. Effectively, this is a form of templating.&lt;/blockquote&gt;If you're still in doubt imagine how many of your beans usually have a dependency on the persistence facade, the document repository, a cipher or a combination of them! A hierarchy of bean skeletons helps immensely (and not only in writing less code).&lt;br/&gt;&lt;br/&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Less is more&lt;/b&gt;&lt;br/&gt;If you've read &lt;a href="http://gettingreal.37signals.com/" target="new"&gt;Getting Real&lt;/a&gt; from &lt;a href="www.37signals.com" target="new"&gt;37 Signals&lt;/a&gt; (it's free and highly recommended!) you're familiar with the term. If you've read &lt;a href="http://www.pragprog.com/the-pragmatic-programmer" target="new"&gt;The Pragmatic Programmer&lt;/a&gt; you are intimate with the DRY (Don't Repeat Yourself!) principle by now. Maybe Martin Fowler &lt;a href="http://www.refactoring.com/" target="new"&gt;Refactoring&lt;/a&gt;? Pick the example you like most, rest assured there are several. All point in the same direction, write less, more concise code. It'll be easier to read, to debug, to maintain and generally it'll work better. The moral is to abandon all complexity!&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/211596987" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/211596987/squashing-boilerplate-in-spring.html" title="Squashing boilerplate in Spring" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=7913015198567608129" title="1 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/7913015198567608129/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7913015198567608129" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/7913015198567608129" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2008/01/squashing-boilerplate-in-spring.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-5261168230379173849</id><published>2007-12-29T04:19:00.000-08:00</published><updated>2007-12-29T06:32:27.367-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="startup tips" /><title type="text">Starting up</title><content type="html">&lt;div style="text-align: justify;"&gt;This is the first time I'm going to blog to recommend something. I haven't done it before because I find it quite boring. There are lots of blogs (and sites) that do it already. Even for technical stuff.&lt;br /&gt;&lt;br /&gt;But I've found &lt;a href="http://www.readwriteweb.com/archives/36_startup_tips.php" target="new"&gt;this post&lt;/a&gt; enlightening. I tried some time ago to build my own company and I failed. Miserably! Really. The worst of all is I didn't take the time, back in the day, to understand what didn't work or what could be improved. &lt;br /&gt;&lt;br /&gt;Read &lt;a href="http://www.readwriteweb.com/archives/36_startup_tips.php" target="new"&gt;36 Startup Tips: From Software Engineering to PR and More!&lt;/a&gt; first and then you'll be able to understand what did I wrong:&lt;ul&gt;&lt;li&gt;Code! Code! Code! Of course...I'm a good Java architect (and programmer) but it's difficult to sell just by saying it loud. People have heard it thousands of times from thousands of different people. Prove it!! Designers have a portfolio. I should have had one as well&lt;/li&gt;&lt;li&gt;Size! Do not try to embrace so many different areas. It's not credible. A small sized company has to focus if it tries to compete. A lot!&lt;/li&gt;&lt;li&gt;And finally..PR. If you're good technically concentrate in that tasks because you probably aren't good at networking. And even if you are, you probably won't have the time to do both things in parallel&lt;/li&gt;&lt;/ul&gt;The bright side is you don't need to accomplish every point in that list to be mildly successful. After more than two and a half years Internna is still open for business (without loosing a cent). I can't commit my full time to it (as I would like) but there it is if the opportunity arises!&lt;br /&gt;&lt;br /&gt;Good luck in your endeavors!&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InternnaOSS/~4/208021704" height="1" width="1"/&gt;</content><link rel="alternate" type="text/html" href="http://feeds.feedburner.com/~r/InternnaOSS/~3/208021704/starting-up.html" title="Starting up" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=1248732249041870352&amp;postID=5261168230379173849" title="0 comentarios" /><link rel="replies" type="application/atom+xml" href="http://internna.blogspot.com/feeds/5261168230379173849/comments/default" title="Enviar comentarios" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/5261168230379173849" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1248732249041870352/posts/default/5261168230379173849" /><author><name>Jose Noheda</name><uri>http://www.blogger.com/profile/05894885162810151648</uri><email>noreply@blogger.com</email></author><feedburner:origLink>http://internna.blogspot.com/2007/12/starting-up.html</feedburner:origLink></entry><entry><id>tag:blogger.com,1999:blog-1248732249041870352.post-9063889084242053532</id><published>2007-12-23T18:00:00.000-08:00</published><updated>2007-12-26T04:23:05.974-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="oss support projects deployment" /><title type="text">Sharing projects with Ant+Ivy+Jetty+Hsqldb</title><content type="html">&lt;div style="text-align: justify;"&gt;Sometimes (well, many times, really) you are in the need to transport a project (or application) from one machine to another. SUN proudly invented the "Write once, Run everywhere" for Java back in the day but let me share a secret with you, it's far from real. Yes, Java itself is cross-platform but there are a lots of other things involved when talking about portability, just a small list could easily include: JVM versions, JDK/JRE dependencies, different environments (OS, net, paths), third party libraries or products, etc.&lt;br /&gt;&lt;br /&gt;If it's an already built application (binary distribution), things become easier. At least, half of the process has been done! In addition, there are some tools available (like &lt;a href="http://izpack.org/" target="new"&gt;IzPack&lt;/a&gt;) that help you in the labor. These tools are focused on client installations so I'll skip them today. I would prefer to talk about sharing code between developers.&lt;br /&gt;&lt;br /&gt;Since the advent of Maven repositories Java has had a decent way to manage dependencies. Unfortunately, Maven has not come without problems and some people (me included) have opted to skip it entirely (if at all possible, of course). The good news is Ant can do everything Maven does (well, I'm not really sure if Ant can create IDE projects for you..not that Maven shines there anyway!). In our case, &lt;a href="http://ant.apache.org/ivy" target="new"&gt;Ivy&lt;/a&gt; is the sanctioned Ant extension to deal with Maven repositories. One of the nicest features it packs is the automatic installation step (if desired), so if the target machine has Ant already installed Ivy can be used without problems. Let's look at the code:&lt;/div&gt;&lt;br /&gt;&lt;div style="border: 1px solid gray; padding: 5px 2px 5px 3px; font-family: courier new; font-size: 12px; background-color: lightgray;"&gt;&amp;lt;project xmlns:ivy="antlib:org.apache.ivy.ant" ...&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;target name="install-ivy"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;get src="http://...ivy.jar" dest="lib/ivy.jar" usetimestamp="true" /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;path id="ivy.lib.path"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fileset dir="lib" includes="*.jar"/&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/path&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;taskdef&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resource="org/apache/ivy/ant/antlib.xml"&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;uri="antlib:org.apache.ivy.ant"&lt;br /&gt;&amp;nb