• Home
  • About
  • Sample Apps
  • Videos
  • Jazoon ‘09: Deploying Java apps from a website

    June 26th, 2009

     

    Session title: Wuala Webstart – Launching a Java Application directly from a Website
    Speakers: Luzius Meisser – Caleido AG / Wuala

     

    LuziusMeisser

     

    Luzius describes Wuala (which I’ve never heard of until now) as an all for offline file-storage. The goal was to make this available in as many contexts as possible, and to get the app up and running as fast as possible, which resulted in them creating their own webstart implementation.

    In the speaker’s implementation of webstart he demonstrates how the app starts before the complete app is loaded… which if I’m not mistaken is also possible in Java webstart.

    The strategy: Load a trusted applet, copy loader.jar into a temp folder and run it. Now RCP exists as it’s own process and consequently survives browser closure…

    On the server-side the apparently smart webstart server (the server counterpart to loader.jar) “learns” which classes are needed first and subsequently delivers the app faster and faster with time.

    Some extremely wordy slides are shown which are impossible to read because Luzius is talking. To read or to listen? That is the question.

    What I’m extracting from this mix of written and spoken words is that their webstart solution enables quicker downloads and updates than conventional Java webstart.

    Summary: This short talk was a little confusing to follow until I realised that I was hearing about two technologies: (a) Wuala – the offline file storage solution; (b) The unique webstart implementation – which was developed in order to improve Wuala’s quality. Nevertheless, I found it quite interesting to learn of the existence of Wuala… 20 minutes well spent.


    Jazoon ‘09: Offline Hibernate

    June 24th, 2009

    Session title: Convenient Disconnected Mode for your Rich Java Application
    Speakers: David Bernhard und Philipp Oser, ELCA

    Szenario: Rich Java Client and app on app server -> work offline without the app on the server. Offline with part of data and syncronize

    Working offline is wished for in a lot of client – server applications. This talk presents a possilbe solution for this problem.

    The hibernate offliner needs a local database and a local persistence framework (here hibernate, but not necessarily) on the client. On the server side two additional db tables are needed to store the mapping information for the remote and local objects.

    Basically the hibernate offliner works as follows:
    To start working offline, the user extracts some part of the data from the database and transfers it to the local database on the client.

    In this process the mapping information is stored on the remote database. It consists of the remote key and the local key.
    After working offline and going online again this data needs to be synchronized. That’s done by fetching the original remote key with the local key and then insert the data remotely. So for the remote db it’s the same thing as working without offliner.

    Object graphs are a bit more complicated they use a graphwalker to make sure that a parent can only be offlined if all of its children are correctly processed.

    Offliner does this by first checking the changes on the client side and insert them into the real database. Then it checks for changes on the server database. What happens to conflicts?

    To identify conflicts version info and optimistic locking is used. When conflicts occur all conflicts are returned. Object graphs can only be processed if no child has a conflict. Conflicts need to be resolved manually by the user. Similar to well known version controls. Force operations exist.

    Limitation:

    • works only with fat clients -> application logic needs to be on the client
    • only a prototype not ripe
    • two set of keys (e.g. positive and negative)
    • not all of hibernate features are available
    • Offliner cannot guess pointers to the offlined objects

    Conclusion: Interesting approach but the restriction to fat clients is kind of disappointing.


    What’s new in JSF 2.0?

    June 24th, 2009

    Session title: A complete Tour of JSF 2.0
    Speakers: Ed Burns – Sun Microsystems, Inc
    Martin Marinschek – IRIAN Solutions

    My interest in this talk is simple to explain: I used JSF in a really cool project last year, and found it cable but wanting in a number of respects. Lets see if the problems have been addressed…

    The speakers begin with quite a few words about how the JSR was the result of a community effort. Then note that JSF 2.0 doubles the scope and integrates Facelets.
     

    P1010119

    And the new features are…

    1. Composite components. To a large extent the philosophy is the same as for rails with pay as you go complexity. Goal was to enable true abstractions. Makes heavy use of naming conventions to reduce verbosity. Composite components builds on top of resources and facelets. Nice to know: Mojarra supports Groovy.
    2. AJAX support inspired by RichFaces, IceFaces, DynamicFaces, ADF Faces. Enables AJAX elements to be specified decleratively or programmatically.
    3. Partial state saving. Biggest problem for performance to-date was the size of the state. Everything was a state and every request was a post. Pre-view state size is now 25% less than prior to 2.0.
    4. View parameters. Inspired by Page Parameters from Jboss Seam. Provides a way to map requests parameters to special components within the view. Reduces the need to redeclare all the params across all the pages in the app. I had this problem in the aforementioned app and am glad to hear this issue has been addressed!!!
    5. System Events. Inspired by Dtrace, influenced by JSFTemplating. This is a publish/subscribe event bus for the JSF app. A suite of events is provided. The list may be extended.
    6. Resources mechanism is now standardised. Separate Filter or Servlet is now no longer necessary. Resources are now logically related to components. Full “library” support (whatever that means), I18N, versioning,
    7. Behaviours enabled you to attach a behaviour to a component in a way which I didn’t quite understand.
    8. Navigation enables pages to be bookmarked. Uses the View Parameters feature to ensure params are validated before rendering the page. Implicit Navigation enables pages to be bookmarked.
    9. Exception Handler enables a single point of failure handling to be defined for a given app.
    10. Validation is integrated with JSR303 Bean Validation
    11. New Scopes have been defined: “conversation” (enables wizard-type functionality); “Flash” inspired by Ruby on Rails, which is used in Master-Detail situations; …
    12. FacesConcext used during startup/shutdown eases the business of keeping things tidy.

    I may have missed one or two points during this rather information-intense session. Nevertheless interesting stuff. Big take-home: JSF2.0 appears far easier to use than its predecessor. It’s also much bigger.

    Conclusion: Valuable information, competently presented.

    Having been asked 2-3 times at Jazoon about my JSF experience. I now have the impression that interest in JSF is pretty high – and growing. I’d have to go back and look at my notes about the project to see what we could have done better using these new features.


    Jazoon ’09: Wednesday Keynote from Danny Coward, Sun

    June 24th, 2009

    Title: Java SE and JavaFX RoadMap
    Speaker: Danny Coward, Chief Architect, Client Software

    Danny begins be showing the JavaFX roadmap…

    Towards the end of the timeline: “JavaFX.next”
    What on Earth could that mean?
    In any case: JDK 7 release due early 2010.

    Top 5 JDK SE 7 features

    1: Modularity
    Long overdue, the current JRE is around 14MB and contains a wide range of APIs. The average app only requires a small proportion of these. It also increases startup time.
    Danny points out a number of weaknesses in the CLASSPATH concept. This will apparently be addressed by a low-level modularilty system entitled Jigsaw.
    http://openjdk.java.net/projects/jigsaw/jcp.prg/en/jsr/detail?id=294
    The concept externalizes the package depenencies to a module file… which reminds me of Eiffel’s solution to this issue which is donkeys years old.

    2: Broadening the JVM to accelerate runtimes
    DaVinci Project should result in a new bytecode model, which enables dynamic invocation, lightweight method handles and a variety of other optimizations.
    http://openjdk.java.net/projects/mlvm

    3: Java Language Additions
    Project coin will result in a few small language enhancements:
    http://openjdk.java.net/projects/coin
    The switch statement will work with Strings.
    Multiple Exception handling
    catch (final IOException | ServletException e)

    Improved type interence will remove the need to double-declare generics so:
    List l = new ArrayList()
    Becomes:
    List l = new ArrayList ()

    Elvis operator eliminates a significant cause of Java’s verbosity:
    String s = mayBeNull?.toString() ?: “nothing”;

    Integer ival = …
    int i = ival ?: -1; // will be set if currently null

    Must confess, this is not what I understand by the Elvis operator, but it looks useful nevertheless.

    4: Four new I/O APIs
    These include: New filesystem API, File notifications, Directory operations, Asynchronous I/O. The latter permits an IO task to be defined using a Future, the Future delivering the result at a later point in time.

    5: New GC
    New garbage collector “Garbage First” should result in predictably low pauses, few full GCs and good throughput. Can be accessed in Java SE6 update 14 using:
    -XX:+UnlockExperimentalVMOptions –XX:+UseG1GC

    This will be switched on by default in JDK 7.

    Danny notes at this point that numerous other (small) features are also part of JDK 7.

    JavaFX 1.2 Top 5
    Danny begins by stating that Sun is trying to make up for lost time with JavaFX (as I have blogged in the past).

    More platforms
    JavaFX 1.2 runs on more platforms i.e. Linux and Solaris in addition to Windows and Mac. LG TV (purchasable in South Korea) incorporates JavaFX1.2. Finally, the HTC developer phone is also mentioned. Danny states that he hopes that phones will be available to consumers on the coming months. Don’t we all!?

    New features
    New widgets, charts, plus a new look and feel. L&F is possible via CSS, which is obviously a whole load easier than creating an L&F for Swing.
    Improved layout management
    Layout management: There are three new layout managers, but I know from experience these don’t yet cut it for non-trivial B2B apps.
    There follow a series of nice looking demos, which highlight that JavaFx is scenegraph based.

    Improved perforamance
    Performance up: Realtime streaming for media is now supported, which improves media startup significantly. Various optimizations in generated code and scenegraph. Bytecode footprint is down 30%.

    Improved data handling
    More and better ways to use data. RSS and Atom feed support. A simple asynchronous framework is also included, plus a simple data storage API.

    One final demo is really impressive: Using the bubblemark demo, Danny demos that JavaFX 1.2 performance is significantly better than Silverlight. Now that I would not have expected!


    Jazoon ‘09: Java Server Faces at Credit Suisse

    June 23rd, 2009

    Session: Jsf and Ajax in the Credit Suisse
    From: Benjamin Bratkus, Credit Suisse; Micha Kiener, Mimacom AG

    It will be interesting to see what CS has been up to with JSF. My last JSF project finished early in 2008. I look back to it with pleasure not primarily because we used JSF but because we really got to use all of the key JEE features under Glassfish – which worked sweetly. JSF (which included facelets), on the other hand…

    CS began with JSF in 2004. Corporations begin what they are, this resulted in a pilot (2005). Release 1 of their app took place in 2007. Since then CS claims to have one of the biggest JSF-based component libraries around.

     

     
    Framework must support:

    • Realtime data
    • Handle huge data sets
    • AJAX and JavaScript due to security aspects

    …and must achieve acceptance by various architects.

    The speakers also used ICEFaces to achieve the required level of interactivity and security. Specifically: Direct-to-DOM rendering (D2D), page level AJAX on existing components, AJAX Push capabilities.

    Key to achieving efficient push: Asynchronous server push, which will apparently become standardised in the next version of ICEFaces. This approach frees up threads on the server-side, which is obviously essential for scalability.

    Summary: Good talk, competent speakers. I still feel sorry for the average AJAX developer, who despite frameworks like ICEFaces is confronted with myriad non-trivial technical details. Plus, I imagine CS is not confronted with the other big pain for browser-based RIA: Multiple browsers.


    Jazoon ‘09: RIA and Security

    June 23rd, 2009

    Session title: RIA Security: Broken by Design
    From: Joonas Lehtinen, CEO IT Mill

    IT Mill is the creator of Vaadin: A 100% Java tool for RIA.

    Joonas outlines a spectrum of complexity from Basic site to 3D games examples:
    Web Sites (Wikipedia), AJAX Sugar (Facebook), Full RIA

    He divides „Full RIA“ divide into client side vs. Server driven. Gives a crash course in GWT.

    Vaadin: Apparently 100% Java and server driven, which sounds an awful lot like ULC at this stage… But here’s a difference: It builds on GWT and relies on JavaScript on the client-side.

    He goes on to present a bunch of development rules:

    Rule #1: Don’t trust the browser
    Rule #2: Complexity is a hiding place for bugs
    Rule #3: Large surface give more opportunities for attack. This surface has increased with Web 2.0.

     

     

    Difference between GWT and Vaadin architectures is that GWT relies on the client invoking a server-side Web Service API, whereas Vaadin renders the client’s view on the server.

    Erm… he then offers the cures for the problems (Rules above)… which I miss because the explanation is compressed into around 5s.

    I’m starting to dislike this presentation at this point. Because here comes another artificial security issue scenario… which guess which product solves. And I thought product placement in Hollywood movies was irritating.

    The issues he raises are legitimate, but the lack of objectivity is obscuring the message. And as I write the presenter is debugging JavaScript which depends on analysing the DOM on the client side – I’m not sure if he’s now analysing the problem or trying to fix it!?

    I am formally declaring myself lost at this stage. At least I hope the other attendees are getting something out of this presentation, which has lost focus IMO.

    He continues with a discussion about attacking at the transport level, inserting new data on the fly. But come on: A secure transaction in this technical setting will operate under HTTPS, which in most instances will deal with this kind of attack. Unless, of course, that’s something else I missed.

    I think I need a coffee!!!


    Jazoon ‘09: iPhone development and Java

    June 23rd, 2009

    Title of this session: Development for the iPhone from a Java Perspective
    From: Software Architect Ognen Ivanski, Netcetera

    Note: Netcetera developed the wemlin app for the iPhone – a useful tool for navigating public transport in the Zürich area.

    Ah… it’s become apparent to me that Ognen will tell us about his personal experience with becoming an iPhone developer, having previously been a Java developer. I have gone through this process myself and so it will be interesting to compare notes…

    Ognen states that the first realisation was that performance, startup-time and UI were kind of new priorities for him. Not really the case for me, I must say. Canoo is known for its RIA experience and therefore these are issues we’ve been dealing with for some time. For the record: The issues which I found most difficult when switching to the iPhone SDK and XCode were:

    - No garbage collection: Clearly I’ve been spoiled by Java
    - XCode: Powerful but nowhere near as comfortable as a typical JavaIDE
    - SCM support: We managed to get Subversion working, but kept running into trouble with things getting out of sync anyway. Best to use the command line

    I certainly agree with Ognen’s observations on XCode: Like me, he missed features such as refactoring and the countless options for viewing, navigating and outlining code.

    Ognen notes that XCode’s visual builder is difficult to get used to but delivers in the end. Possibly like many Java/would-be iPhone developers, I shied away from the visual designer, opting to code from hand instead. Perhaps for my next iPhone app I’ll take a look at it again.

    I agree with Ognen’s observations on Objective C syntax. It’s got a “familiar and yet somewhat strange” feel to it. The behaviour around “nil” seems odd at first, but one quickly learns to appreciate that it pays not to have to check for null values all the time, as in Java code.

    There follows a lot of examples of Objective C Syntax.

    Patterns of note in the iPhone world: Delegate pattern, Target/Action pattern, MVC – which is perhaps truer to the original Smalltalk concept that what we typically see in Java swing, say.

    In summary: A good presentation, but no new insights for someone who’s gone through the process of switching from Java to iPhone development already.


    Jazoon ‘09 gets underway with James Gosling

    June 23rd, 2009

    Hi everyone and welcome to Jazoon ’09!

    At Sihlcity just a few tram-minutes away from Zurich’s city center, Jazoon ‘09 begins in the biggest auditorium (now full) with some very loud video sequences. Chris – from I don’t know where – tries his best to wake up a clearly very sleepy audience. He fails. More coffee for the audience please!

    Next up a rerun of the Monty Python-esque “Brief History of Java” featuring JG… who now takes to the stage!

    We’ve already seen James “the man thanks to whom I could purchase my first house” Gosling hanging around the exhibition center this morning. Title of his keynote: “Where we’re heading”.

    JG puts the network at the center of things; emphasises the ubiquity of Java (nice observation: more Java devices than humans on the planet!) Other rough estimates: 6M Java developers (most of them rubbish, I should note – OK I suppose that was a bit harsh) and 15M JRE downloads per week on average – not including the PC’s that are rolled out with a JRE!

    Some impressive examples of major Java apps: Brazilian healthcare, Large Hadron Collider (at the physics research institute CERN near Geneva etc. etc. This is indeed true: Java is everywhere. I don’t know how many JavaCards I have in my wallet.

    JG now emphasises the VM, giving it more importance than the Java language. I naturally think of Google’s Android and the completely re-architected VM called Dalvic.

    Next up: JG demos Glassfish V3 and in particular talks about the simplifications that have taken place since V2. Annotations and injections are basically the key to this. I’m reminded of a project I did on V2 a little while back. Other than the integration with MQ Series (which proved a little tricky) Glassfish turned out to be one of the most satisfying App Server experiences I’d ever had. Glassfish succeeds in combining the characteristics of being super-easy to install and configure, and yet it is clearly highly scalable; IBM please take note. I’m not on Sun’s payrole, I promise!

    JG now demos the Hudson integration server as well as Kenai, which he describes as a cloud service for development. Amongst other things, this allows development for hardware which one may not actually own or have access to.

    Next up: Java Real Time. The challenge: How to garbage collect (GC) deterministically. JG talks about the balance GC designers needs to find between performance and determinism. Rightly notes that there are even stock exchange apps, which require this level of control.

    Talking of “control”, JG describes Neal Young’s LincVolt car and the degree of control that Real Time Java has and how this leads to superior efficiency.
    And on the subject of efficiency, JG compares Java performance with C++ and is happy to note that in most everyday situations Java is way ahead.

    A subject close to my heart: JSR248, the Mobile Services Architecture which is designed to unify a bunch of individual JSRs. The motivation for this is that to-date mobile hardware vendors have consistently delivered different combinations of JSRs, which basically makes a joke of write-one-run-everywhere. The bad news from JG: MSA still has a way to go. Good news for Android?

    Changing direction, JG notes that the Web is now the face of the organisation. JavaFX will (apparently) deliver a Flash-like (to use JG’s expression) experience to address the expectations of the next generation of end-users.

    JG describes some of the basic JavaFX features and talks about the graphical design tool that was demo’d at JavaOne – but stresses that it’s a long way from GA. Back to what can be done today: Using Photoshop and Illustrator to create a static UI design, which can be subsequently programmed out by the JavaFX developer. This is precisely what I talked about at J1 a few weeks ago.

    Exit JG stage left to applause.

    Well, it’s now off to the sessions. Tune in later for some more live session blogging!!!


    Mike’s JavaOne talk entitled “JavaFX in Action: from Design Tool to Desktop to Mobile Device”

    June 5th, 2009

     

    OK I admit it, I was pretty nervous about this one.

    On the face of it my talk today on our experiences with JavaFX appeared to go well, but the truth is it’s always difficult to objectively judge whether a talk is well received.

    A handful of attendees came to me personally to thank me (which is always very rewarding) and a few others came to the Canoo stand whilst I wasn’t there. A touch strange and disappointing, however, was the lack of questions at the end of the session. Experience tells me I didn’t answer all of the questions that could possibly be asked! So why the silence? Was everyone thinking just about lunch? It would be so nice to know!

     

     


    J1 Session-Blog: Return of the Puzzlers (Schlock and Awe)

    June 3rd, 2009

     

    Dressed in boiler suites, Joshua Bloch (Google Inc.) and Neal Gafter (Microsoft) put on quite a show in which they present a series of traps to be avoided in the Java language…

     

    Joshua Bloch (Google Inc.) and Neal Gafter (Microsoft)

     

    •    First problem: What does Boolean (Strings) do? Answer: Depends on the value of a particular system property – which is obviously completely horrible.
    •    Second problem: Overriding addAll/add of a HashSet is dangerous. Something we should all know because (for example) addAll may be implemented in terms of add. Answer is to create a so-called forwarding set, in which the inhertance characteristics of the implementation are defined by us. A class whose self-use patterns are not explicitly defined and documented should not be inherited from. Google collections provides a suite of forwarding classes.
    •    Third problem: Unpredictable behaviour caused by invoking a public (overridable) method in a constructor. Apparently Brian Goetz has made this mistake.
    •    Fourth problem: Searching which depends on a comparator is broken. In the example the comparator is broken because autoboxed integers cannot be tested for equality with. In addition, Comparator must implement total ordering, which in this example is broken because of the auto-boxing.
    •    Fifth problem: Initialization error caused by invoking enum constructor when a static variable has not been initialized.
    •    Sixth problem: Memory leak caused by assigning a large number of values to non-static thread locals. Thread local contains a weak hashmap.  This is a complicated one to follow. One obvious moral: Don’t use non-static inner classes.
    •    Seventh problem: Problem caused when two versions of a class contain different constant definitions. Contants are inlined in Java. However, null is not considered a constant in this sense.

    Overall: As we’d expect, nasty little problems which are likely to occur at some point in the developer’s life. Bloch suggests using “FindBugs”, which will apparently detect all of the above problems.