• Home
  • About
  • Sample Apps
  • Videos
  • 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!!!


    J1 Session-Blog: Ajax vs. JavaFX Technology

    June 3rd, 2009

    First note that the speakers Ben Galbraith and Don Almaer are co-founders of ajaxian.com, which is clearly an AJAX-shop. They claim that Web technologies and Java went stagnent in the UI space. Ajax and JavaFX have the characteristics of a renaissance. They structure the talk in the form of a “discussion” or a series of arguments, where one supposedly pits the advantages of said technology against the other.

     

    •    Argument #1: Java performs way faster than JavaScript; on the other hand JavaScript is getting faster all the time (V8 team at Google); plus apps like Google wave demonstrate that performance is good enough.
    •    Argument #2: Responsiveness improved by worker-threads in a Java GUI. Yet using “web workers” we can overcome the limitation of JavaScript to a single thread. Demo of Pictastic proves the point. Having said that, web workers are still 10 times slower than Java; plus the API is extremely limited. In “web worker”, worker threads don’t share state, which is way safer than the totally flexible Java approach.
    •    Argument #3: GC way more advanced in Java. On the other hand, incremental GC in Mozilla is improving all the time. A lousy fact of the JVN is having to determine how much memory the app requires (or how much is available) wherever the app is deployed.
    •    Argument #4: Graphical capabilities of Java surpass what web apps can do. But performance of Bubblemark benchmark app shows that Google chrome achieves 100 frames per second. By comparison JavaFX achieves 24 FPS. With vector graphics Chrome is back down to 30 FPS. What the speakers don’t consider is that JavaFX is a very new and to-date under-optimised technology.
    •    Argument #5: An Ajax 3D demo “metatunnel” is pretty impressive. Most browsers, apparently, are offering 3D extensions. It’s still at the experimental stage, however. JavaFX, on the other hand, has nothing to show in 3D.
    •    Argument #6: Java is weak on fonts. The speakers claim that can’t use native fonts in Java (is this true? I seem to remember supplying Java with some additional fonts some years back.) Control over fonts in the Ajax world is even more limited, however.
    •    Argument #7: JavaFX provides “amazing” video support. Counter argument: Flash plugin us ubiquitous and surpasses JavaFX in terms of maturity. Open Web Video offers sophisticated video functions.
    •    Argument #8: Binding in JavaFX is compact and elegant. Web toolkits are very clumsy by comparison. The speakers quickly mention Mixins, Animation and Effects. All of this is way easier in JavaFX…
    •    Argument #9: Legitimate critisisms are raised about JavaFX syntax. Speakers suggest that JavaScript is actually easier and closer to Java than JavaFX Script. And, of course, JavaFX totally lacks widgets like table/tree. Web toolkits even provide some very cool layout management and tools for constructing GUIs.
    •    Argument #10: Tooling superior in the Java world.
    •    Argument #11: Deployment. Web wins here, obviously, except for significant browser incompatibilities. Applets, Mac etc. are lousy too, however.

     

    Conclusion: A pretty damning result for JavaFX, which is for the most part justified (at least today.) What the speakers fail to do, however, is talk more fairly about the significant problems faced by AJAX developers on a daily basis.


    PillarOne: Open-Source Framework for Risk Management Uses UltraLightClient and Grails

    April 3rd, 2009

    BrusselsOver the last two days I attended the PillarOne Conference in Brussels. (PillarOne Conference? Never heard before? That’s probably because this is the first time this conference has taken place.)

    The main focus of the conference was not about Web applications or Rich Internet Applications; it was about risk management in the financial sector and how open-source software can assist in averting financial collapse of the kind we’re currently facing.

    Over one year ago Munich Re (one of the world’s largest re-insurers) initiated the development of an open-source business application suite entitled PillarOne. PillarOne seeks to address every aspect of reserving and risk analyses of insurance companies. Open-source has particular relevance to this business: Identifying and simulating risk cries out for openness and for a strong community that actively validates the applied models and methods. There is absolutely no doubt that conducting Risk Management behind closed doors and concealing models behind inappropriate tools like Excel has contributed to the current financial crisis.

    Intuitive Collaboration\'s Markus Stricker points the direction of future risk management tools.
    Intuitive Collaboration’s Markus Stricker points out the direction of future risk management tools

    Risk management tools like this also have special requirements which are perfectly met by Rich Internet Application technology like UltraLightClient. Firstly, the complex models and simulations need highly interactive and responsive user interfaces designed for power users. Secondly, truly capable risk management tools must be enterprise solutions with all features these solutions normally have (central database, logging, historization, multi-user synchronization etc.). On the other hand, risk managers are used to having their tools on their laptops being fully functional even if they are off-line. Intuitive Collaboration – the company behind PillarOne – has chosen Grails and UltraLightClient because they meet both these requirements. UltraLightClient is a web-based user interface technology that in conjunction with Grails enables the cost-effective implementation of web applications with the most sophisticated user interfaces that are vital for handling the complex domain of risk management and simulation. Moreover, an application can be deployed as on an enterprise server or as standalone tool on a risk-manager’s laptop without changing a single line of code in the application.

    SAP Demo
    Canoo’s Dierk König and SAP’s Christos Lemonidis demonstrating the SAP integration of ULC and Grails based PillaOne

    That PillarOne is a milestone for risk management tools is underlined by the fact that SAP has chosen this platform to offer Solvency II compliant risk management to its insurance customers. Just in time for the conference, the UltraLightClient-based PillarOne was successfully integrated into SAP and shown at the conference as an online demo to a captivated audience.

    The conference was attended by a large number of risk managers and regulators, one of whom (a speaker) was bold and self-effacing enough to describe the current crisis as “collective failure of a whole profession”. Whatever the full spectrum of reasons behind this collective failure is, the potential of an open-source tool such as PillarOne is to provide the system with a degree of transparency and robustness that would have been unthinkable a few years ago. This has got to be a good thing for all citizens, not just risk managers!


    Canoo Official Launch Partner for JavaFX Mobile

    February 11th, 2009

    Canoo is delighted to announce that it will be attending the official launch of Sun Microsystem’s JavaFX Mobile technology at the Mobile World Congress in Barcelona 16-19 February 2009.

    JavaFX Mobile aims to make it easier for developers to provide a Rich Internet Application (RIA) experience on state-of-the-art mobile devices, whilst leveraging the ubiquity and capability of Java. Sun’s choice of the MWC as launch event is indicative of the importance it places on the mobile platform for Java’s future.

    Canoo is one of a handful of so-called “Java application showcase project” partners. These partners were specifically chosen by Sun because of their leading roles in the booming Rich Internet Application (RIA) market place.

    Canoo senior software engineers Mike Mannion and Alberto Mijares will be talking about Canoo’s experience with JavaFX Mobile technology, and will be on hand to demonstrate a brand new version of Music Pinboard entitled Music Pinboard Mobile. The application will be running on a number of the latest hardware devices at the Sun stand.

    Here’s a screenshot of Music Pinboard Mobile:
    Music Pinboard Mobile screen shot


    How Rich Internet Applications can save taxes

    November 26th, 2008

    Switzerland and the EU are committed to utilizing the benefits of the Internet and Web technology in order to streamline their administration and to make it easier for the citizen to interact with his or her government. In its role as service provider, governments seek to provide a single point of contact (a portal or a human public servant), who guides the help-seeking citizen through a complex web of public administration. This – at least – was the message of the eGovernment Symposium held in Bern on Tuesday November, 18th 2008.

    SAP\'s approach to user-centricity

    One of the topics covered in depth was user-centricity – of course an essential point if a government is serious about making engagement with public administration easy for its citizens. As a tax payer I was a little bit worried about the fact that SAP is contributing its complex Netweaver™ technology to the user-centricity discussion (see image to the left – sorry, I have only a German version). But if the ones responsible for eGovernment follow the suggestions of Christian Wanner from LeShop - the Swiss Amazon for food supply – I feel more comfortable again. The value of the experience he gained over several years cannot be understated. To summarize:

    1. A user interface – especially on the internet – can never be simple enough.
    2. Users do not read instructions – and if they do read them they frequently do not understand them correctly even if your developers are convinced that everybody in the world can understand them.
    3. Let real users randomly chosen from the street (not the colleague at the next desk) try out the user interface – you will see the proof for the first two points.

    There is one important point I would like to add to this: Governments should take great care when designing and implementing user interfaces for their public servants, who are to subsequently provide services to the citizens. Following this advice can actually lead to dramatic tax savings, and here’s why: Offering a public web interface to citizens requires that internal processes are automated. These proceses will frequently cross the border of departments – especially if a single point of contact shall provide complex services as, e.g., founding a company. Thus, public servants need effective interfaces to sub-service providers. Tools should be designed to support the productivity of the public servants as much as possible in executing such cross-departmental processes.

    Wasting the time of our public servants is wasting our taxes.

    Public servants as web application users require sophisticated (not complicated!) interfaces. In contrast to a citizen who – hopefully – only rarely has to use the web interface to contact public administration the public servant will use his or her tools very frequently – perhaps every day, many times a day. A citizen, therefore, requires self-explanatory interfaces – interestingly in most cases perfectly covered by pure HTML-based applications (no Ajax required). Our public servants on the other hand, need highly optimized, but not necessarily self-explanatory interfaces. It is worth spending some tax Francs or Euros on the training of staff on the systems. They will return our investment very soon by being more productive (or at least their tools are not to blame if they are not productive). 

    Different user-interface paradigms for different user types

    Such interfaces cannot be implemented using standard HTML-based technology. They require a different interface paradigm – instead of forms and pages that are filled up and read one by one in a sequence (request-reply-style) – the interfaces for our public servants must be highly interactive, asynchronous, and in a position to display and change more than one thing at a time. This is normally best covered by event- and component-based user interface technology, such as we know from desktop applications like office tools (cf. picture to the right).

    Thus, Rich Internet Applications are vital for implementing eGovernment and making our public servants effective which – in the end – means that our governments will save money (our taxes!)

    I hope that user-centricity as discussed at the eGovernment symposium is taken seriously and that session chair Peter Fischer’s closing words will not come true: “User-centricity means that the user is always standing in the center and, therefore, in everyone’s way.”


    Canoo @ WJAX/SOACon 2008

    November 17th, 2008

    This is just a quick note about the WJAX Java developer conference that take place last week in Munich.

    The conference program was quite balanced and beside the main stream topics about SOA (ServiceOrientedArchitektur – represented by the SOACon conference), Spring, Application Security and OSGi there was a huge number of different topics, which were addressed by several talks.

    Most interesting from my point of view were following sessions:

    • Keynote from Jonas Jacobi: Re-architecting the Web with HTML 5 Communication.
    • Talk from Karsten Lentzsch: Efficient design of swing UI’s.
    • Talk from Angelika Langer: Java programming in the age of multicore.
    • Talk from Dierk Koenig: RESTful JEE with Grails.


    Canoo was exhibiting on a booth, which gave the great opportunity to present and talk about our products UltraLightClient (ULC), the just released language application for the IPhone (using canoo.net), our demo for the new JavaFX platform and fancy UltraLightClient / Swing rich client applications. In addition Canoo members used the presence to keep in touch with existing costumers, contact new ones or presented the company to potential new staff members.

    Canoo Online Quiz

    All the visitors on the booth and all other interested software developers had and still have the possibility to join an online quiz. Its possible to win an iPod touch or one of ten ‘Groovy in Action’ books. The quiz can be found at www.canoo.com/quiz and will end at the 30.11.2008.

    Dierk König, Canoo fellow and author of the ‘Groovy in Action’ book, was holding a groovy workshop and was giving a talk about RESTful JEE with Grails.


    What’s Needed Besides the Presentation Model?

    October 14th, 2008

    In the previous chapter we discussed how a simple presentation model framework can substantially reduce the implementation effort for complex user interfaces while at the same time delivering a clean and maintainable software design. However, the presentation model framework is still not sufficient for an efficient implementation of the presentation layer. What else do we need? We can identify the following areas:

    • Attaching user interface components to model properties can be quite cumbersome . Some kind of binding infrastructure takes care of this.
    • Configuring user interface components through a low-level API takes too many lines of code and does not guarantee consistency. A component factory helps to do this with less code and more consistency.
    • Validation can be a tricky beast. Adding validation in the presentation layer is required for better feedback but leads to duplication of business layer validation logic.
    • The design of ergonomic, consistent and visually attractive form-based user interfaces is a challenging task. Furthermore, coding such user interfaces can take way too long without a decent infrastructure.

    Binding
    Generally speaking, the term “binding” denotes how to keep to properties in sync. In the case of user interfaces one property is hosted by a view component and the other one is exposed by the presentation respectively domain model. As we have seen in our examples this is a two-way sychronization. Without a binding infrastructure you have at least to register an event listener at the user interface component which gets notified about value changes and sets the model property accordingly. Additionally, the user interface component needs to register as an observer to the model property and update the visualization correspondingly. A binding infrastructure can replace multiple lines of code to accomplish the above with a single line of code which is even more expressive and comprehensible. Model properties can be visualized in quite different ways. For example, an integer value could be visualized as a number literal in a text field or as a selection a radio box, check box group, or a combo box. The binding infrastructure should cope with all these variations.
    If user input is not to be immediately commited to the model property the binding infrastructure can buffer these value changes. Finally, the binding infrastructure has to care for value conversions back and forth, e.g. the input field component only accepts strings but the model property is a number.
    For Swing there are several binding infrastructures available: probably the most popular one is JGoodies Binding. JSR 295 is another approach, a reference implementation of which can be found here.

    Component Factory
    The components of common user interface toolkits such as the Swing library expose a large number of properties. Usually, a developer has to configure a component instance to her needs by setting the necessary properties one by one. This not only leads to many lines of code but consistency is also hard to achieve even within the same view. For example, the input field for a customer id should look and behave the same within and across several applications. A component factory both encapsulates the creation and configuration of generic and domain specific user interface components. Even for small projects a component factory is highly recommended.

    Validation
    Rich Internet Applications do not demand more validation but more frequent validation. With this type of application a user would like to get immediate feedback as he uses the application. The implementation of such fine granular feedback is much more demanding than with a classical web application which gets validated once when submitting the entire form. In order to give immediate feedback, the presentation layer has to validate immediately on user input. Nevertheless, the business layer cannot trust the presentation layer upon validation and therefore it again has to validate all data in its services. Unfortunately, this might lead to code duplication. Clever modularization can factor out the validation code which can the be shared between the presentation and business layer. However, sharing is only possible if you have the same run-time environment for the presentation and business layer. In a scenario where your business logic is implemented in Java and your presentation layer is based on JavaScript you are out of luck and forced to reimplement parts of your validation in JavaScript.
    Basically, there are two types of validation, syntactical and semantical. Syntactical validation should be hosted in the presentation layer in any case, even at the cost of code duplication. You can simply not afford to call a validation service with every user keystroke. Syntactical validation can usually be expressed descriptively and hence it might be sufficient that the business layer just returns a formal description of the validation which is interpreted in the presentation layer. This helps to avoid code duplication. With semantical validation it’s a different story. It is recommended to provide this type of validation as a business service. Semantic validation probably means to access further services or a database. Duplicating this code in the presentation layer is not only expensive but also incurs a performance penality when triggering serveral client-server round-trips. An example for a validation framework for Swing is JGoodies Validation.

    Form Layout
    Designing ergonomic and visually attractive form-based user interfaces is far from trivial. If you have ever tried to achieve this with the basic Swing components and the gridbag layout manager you know what I am talking about. Granted, there are better layout managers, e.g. MiG, JGoodies Forms, the GroupLayout Manager, or the new ULC form component. If you are looking for a comparison of different layout managers, the layout manager showdown has a nice overview. Using these layout managers it is definitely easier to design forms but if you have to implement dozens of densily crowded forms it is still a drag. The problems are efficiency and consistency. Most likely your applications features a few basic form patterns, e.g. a master detail view, search view, etc. Even with an advanced layout manager there is too much design variability for a developer which hampers efficiency and certainly does not lead to a consistent user interface., especially when developing in a team. Therefore, it is recommended to build project (or company) -specific form components which kind of hard-code the layout. This easily pays off with increased development efficiency and user interface consistency. In a recent project we identified the common user interface patterns upfront (we call it meta design) and implemented the necessary form components. As a result, the developers are way more efficient and the user interface of this application (featuring hundreds of form views) is surprisingly consistent.

    The presentation model is indispensible for realizing the complex user interfaces of Rich Internet Applications. It takes very little infrastructure (implemented as a framework), even when extending the presentation model approach with application components for a hierarchical decomposition of complex user interfaces. If you add binding, a component factory, validation and meta design to that your Rich Internet applications will be ahead of those from your competitors with respect to time to market and visual attractiveness.

    Part 1: MVC and the Brave New World of RIA
    Part 2: The World Needs More Models
    Part 3: A Simple View on Complex Stuff
    Part 4: Hierarchies
    Part 5: Presentation Model Framework
    Part 6: What’s Needed Besides the Presentation Model


    Presentation Model Framework

    September 19th, 2008

    In the previous chapter we looked at the implementation of a non-trivial application composed of several application components. If you had a closer look at the code fragments in chapter 3 you probably realized that even for a simple application component quite some boiler plate code was required to make it work. The presentation model contains infrastructure code that takes care of property listener handling, e.g. registering property change listeners and distributing property changes to listeners. It also has to delegate most property requests to the business object. These tasks can easily be extracted into a base class and handled generically.
    In addition, the base class can provide infrastructure such as:

    • Creation, proper initialization, and management of a hierarchy of application components: the root application component is responsible for property change listener management, i. e. all sub-application components delegate to the root application component rather than managing this all over the hierarchy, which simpifies debugging a lot.
    • Breaking cycles: the execution of a property change listener should not trigger (directly or indirectly) the same property change listener.
    • Undo/Redo support: The presentation model is a Java bean and all state transitions are performed by property changes. Hence, undo/redo support is really easy to implement on a generic basis. The abstract presentation model just records all property changes and can undo or redo them on request.

    This leads to a simple presentation model framework with only a few hundred lines of code. It is independent of any widget library, although the current implementation includes configurable table and tree models based on the ULC widget library. They should be easily replaceable by model implementations of some other component library.

    The view code is even more cumbersome. Despite being pretty straightforward way too many lines of code are needed for implementing the view. How can this be simplified?

    • Creating the layout can be accomplished by using either a declarative or programmatic approach. For the declarative approach one would need some XML schema for defining the components and layout of the user interface. At run-time, an interpreter creates the UI based on the XML description. The programmatic approach requires at least a layout class which is tailored to form-based user interfaces. Examples are JGoodies Forms or the new form infrastructure in UltraLightClient ‘08.
    • Connecting the widgets to the presentation model and vice versa can be vastly simplified by utilizing some binding infrastructure. We will talk about binding in the next chapter.
    • The remaining tasks are easy to implement and require little code: proper initialization of the view (most initializations are triggered by the presentation model anyway), forwarding events to the presentation model that are not yet taken care of by the binding infrastructure (e.g. button actions), and reacting to changes in the presentation model (e.g. enabling/disabling portions of the user interface accordingly).

    Now lets have a look at the code for the example from chapter 3. For the programmatic layout of the form I used a simple form layout class.

    The core code for the presentation model looks almost like the example given in chapter 3 (boiled down to three model properties for the sake of simplicity). Thanks to the presentation model framework, the number of lines of code is cut almost in half (now less than 150 lines of code incl. comments and blank lines).

    public class SimpleFormPresentationModel extends AbstractPresentationModel {
        private Person fPerson;
        private ErrorList fErrorList;
     
        public final static String PERSON_NAME = "person.name";
        public final static String PERSON_FIRST_NAME = "person.firstName";
        public final static String ERROR_LIST = "errorList";
     
        private final static String[] PREFIXES = {"PERSON", "UNIVERSITY"};
     
        public SimpleFormPresentationModel() {
            fHasChangedEnabler = new ULCHasChangedEnabler();
        }
     
        public void basicInit() {
            fErrorList = new ErrorList();
            fireAllPropertiesChanged(PREFIXES);
            addPropertyChangeListener(this, getAllPropertyNames(PREFIXES));
            super.basicInit();
        }
     
        public void update(String propertyName, Object oldValue, Object newValue) {
            if (propertyName.equals(PERSON_FIRST_NAME)) {
                validatePerson(PERSON_FIRST_NAME);
                firePropertyChanged(PERSON_NAME, getPersonName(getPerson()));
            }
        }
     
        public Person getPerson() {
            return fPerson;
        }
     
        protected void setPerson(Person person) {
            fPerson = person;
            fireAllPropertiesChanged(PREFIXES);
            fHasChangedEnabler.reset();
            setFocusToProperty(PERSON_FIRST_NAME);
        }
     
        public String getPersonName(Person person) {
            return person != null ? person.getFirstName() + " " + person.getLastName() : "";
        }
    }

    Some functionality is based on conventions which can be customized by overriding the appropriate methods. Properties are “exported” by declaring the path as a string constant, e.g. PERSON_NAME. The business object is referenced by an instance variable. The prefixes of the property constant names are kept in the string array PREFIXES. This way, properties can easily be retrieved by reflection. This is used to fire property change events or register event listeners for all properties.

    Theview class is also reduced to half the lines of code. This is mainly due to the form layout class and the binding infrastructure.

    public class SimpleFormPane implements IPropertyChangeListener {
        private FormLayout fFormLayout;
        private ULCBoxPane fFormPane;
        private ULCTextField fName;
        private ULCTextField fFirstName;
        private SimpleFormPresentationModel fFormPresentationModel;
        private Binding fBinding;
        private Color fErrorColor = new Color(255, 0, 0, 192);
     
        public SimpleFormPane(SimpleFormPresentationModel formPresentationModel) {
            fFormPresentationModel = formPresentationModel;
        }
     
        public ULCComponent getPane() {
            if (fFormLayout == null) {
                createForm();
                fBinding = new Binding(fFormPresentationModel);
                fBinding.bindText(PERSON_NAME, fName);
                fBinding.bindText(PERSON_FIRST_NAME, fFirstName);
            }
            return fFormPane;
        }
     
        private ULCBoxPane createForm() {
            if (fFormLayout == null) {
                fFormLayout = new FormLayout(FormLayout.NULL_RESOURCE_RESOLVER, "PersonForm");
                fName = new ULCTextField(20);
                fFirstName = new ULCTextField(20);
                fFormLayout.addComponent("Name", PERSON_NAME, "Name:", fName, true, "1EE");
                fFormLayout.addComponent("FirstName", PERSON_FIRST_NAME, "First Name:", fFirstName, "1EE");
                fFormPane = new ULCBoxPane(true);
                fFormPane.add("et", fFormLayout.getPane());
            }
            return fFormPane;
        }
     
        public void update(String property, Object oldValue, Object newValue) {
           if (property.equals(LOADED)) {
                fFirstName.requestFocus();
                fLoadButton.setEnabled(!(Boolean)newValue);
            } else if (property.equals(FOCUS)) {
                ULCComponent component = fFormLayout.getComponent((String)newValue);
                if (component != null) {
                    component.requestFocus();
                }
            } else if (property.equals(ERROR_LIST)) {
                ErrorList errorList = (ErrorList)newValue;
                for (at.diefaehre.argo.util.validation.Error error : errorList) {
                    ULCComponent component = fFormLayout.getComponent(error.getProperty());
                    if (component != null) {
                        if (error.isError()) {
                            component.setBackground(fErrorColor);
                        } else {
                            component.setBackground(Color.white);
                        }
                    }
                }
                setFocusToFirstError(errorList);
            }
        }
     
        private void setFocusToFirstError(ErrorList errorList) {
            if (errorList.hasErrors()) {
                for (String field : new String[]{PERSON_FIRST_NAME, PERSON_LAST_NAME, PERSON_UNIVERSITY_ID}) {
                    if (errorList.containsError(field)) {
                        ULCComponent component = fFormLayout.getComponent(field);
                        if (component != null) {
                            component.requestFocus();
                            break;
                        }
                    }
                }
            }
        }
    }

    Now, what does it take to add undo/redo to this example? As mentioned before, the abstract base class for the presentation model already contains generic undo/redo support. All we have to do is offering undo or redo in the user interface. I simply had to add two additional buttons for that, which call undo resp. redo on the presentation model. In addition, the view has to enable or disable the undo/redo buttons if undo/redo is possible or not. The abstract presentation model triggers this event conveniently. The extensions to the presentation model are minimal. It has to reset undo/redo when loading or saving the business object and it sets the focus in the view to the component which was affected by undo/redo.

    How does the presentation model fit into an application which needs to render live data. Actually, the presentation model can also handle this scenario quite nicely. There is only one issue to consider. The data feed can be considered as yet another model which the presentation model can subscribe to. Thereby the presentation model is notified about any relevant model changes. However, these model events most likely occur outside of the UI event thread (e.g. posted by some server) and therefore they cannot be processed synchronously by the presentation model which runs in the UI event thread. The solution is quite simple. The presentation model stores these events in a queue which is processed prior to the next event that occurs in the event thread, i.e. the next event that is going to be processed synchronously. While processing the asynchronous model events the undo/redo recording has to be temporarily suspended since these events are not created by the user and therefore undo/redo is pointless.

    The presentation model framework is available Presentation Model Framework. It solves many design issues in rich user interfaces and also helps developers to focus on implementing cool and ergonomic user interfaces rather than dealing with design and infrastructure issues. The framework is also independent of the user interface component library. The only exception are the table and tree model adapter classes which are specific to the ULC component library. It should be pretty simple to replace them with an implementation for the user interface component library of your own liking. Also included in the download are a number of examples which demonstrate how to use the presentation model framework. These examples were implemented with the ULC component library. In order to compile and run them you also need to download the ULC component library. You can get a free evaluation license for ULC here. Additionally, the examples need some infrastructure code (e.g. binding, form layout and validation support) which comes with the download. This infrastructure code has been extracted from a larger project and stripped down to minimize dependencies. Hence, they do not really serve as an example.

    In the last chapter we will have a look at additional infrastructure which even more simplifies implementing rich user interfaces.

    Part 1: MVC and the Brave New World of RIA
    Part 2: The World Needs More Models
    Part 3: A Simple View on Complex Stuff
    Part 4: Hierarchies
    Part 5: Presentation Model Framework
    Part 6: What’s Needed Besides the Presentation Model


    Canoo CEO to present course on RIA and AJAX at ETH Zürich

    September 3rd, 2008

    Hans-Dirk Walter, CEO at Canoo EngineeringCanoo’s CEO Hans-Dirk Walter is presenting a one day course on Rich Internet Applications and AJAX on 12th September 2008.

    The RIA course is part of a three day training “Web-basierte Informationssysteme” from 10th to 12th September 2008 and will be held in German at the ETH in Zürich. Participants may choose to attend only one day or the entire course.

    Praktisch alle Menschen haben Zugang zum “Web”, sei es privat, dienstlich oder zunehmend auch mobil. Das Web ist damit praktisch jederzeit für jedermann verfügbar. Der große Erfolg des Webs liegt darin begründet, dass das Web die Kosten für das Abrufen und Bereitsstellen von Information stark reduziert hat. Dieser dreitägige Kurs stellt die grundlegenden Technologien des Web und der Entwicklung von Web-basierten Anwendungen vor. Am ersten Tag werden Web Services und dienstorientierte Softwarearchitekturen (SOA) vorgestellt, die die Grundlage für verteilte Informationssysteme bieten. Am zweiten Tag wird XML als eine der grundlegenden Technologie zur Repräsentation, Speicherung, Austausch und Verarbeitung von Information vorgestellt. Am dritten Tag werden Rich Internet Applications und die Programmierung von modernen graphischen Benutzerschnittstellen behandelt.

    Here is a summary of the RIA topics that will be presented (in German):

    Rich Internet Applikationen (RIA) sind die nächste Generation der Webtechnologie. Sie verbessern die Benutzerschnittstellen und erweitern den Anwendungsbereich von Webapplikationen entscheidend. Ihr wesentlicher Beitrag: sie verbinden die Vorteile server-basierter Web-Technologie mit Interaktionsmöglichkeiten für den Benutzer, die man sonst nur von lokal installierten Desktop-Applikationen kennt.

    Durch das Schlagwort AJAX und Anwendungen wie Google Maps, Flickr oder e-Opinion, die mit dieser Technologie implementiert sind, wurden Rich Internet Applikationen über die technische Entwickler-Community hinaus bekannt.

    Häufig wird übersehen, dass AJAX nur eine (sehr einfache) Implementierungsalternative ist, um das übergeordnete Ziel ergonomischerer Benutzerschnittstellen zu realisieren. Dieser Kurs gibt einen Überblick über die Ziele, die man durch den Einsatz von RIA Technologie verfolgt, die Architektur und Entwurfsmuster für Rich Internet Applikationen sowie einen Überblick über Technologiealternativen, um solche modernen Systeme zu realisieren. Zusätzlich zu den Konzepten werden Demonstrationen und praktische Beispiele geliefert, um eine richtige Erfahrung mit diesen Technologien zu bekommen.


    Summary of the Course Details:

    When: Wednesday 10th September 2008 to Friday 12th September
    Where: ETH Zürich, IFW-Gebäude, Hörsaal A 36 , Haldeneggsteig 4
    Lecturers:
    Prof. Dr. G. Alonso, ETH Zürich
    Prof. Dr. D. Kossmann, ETH Zürich
    Dr. H.-D. Walter, Canoo AG
    Course name: Web-basierte Informationssysteme

    ETH Zürich Kompaktkurs zum Thema RIA und AJAX


    Register for this course
    at the ETH Zürich website.

    This course is part of an ETH Zürich course program for IT professionals called “Kompaktkurse für Informatiker”.


    Not deploying RIAs is “not an option.”

    August 8th, 2008

    I stumbled across this report discussing Web 2.0 within an enterprise context, which I would like to recommend:

    “Web 2.0 Gets Down to Business”.

    The report discusses the results of an Information Week survey and presents some interesting charts and numbers, e.g. why companies introduced RIAs , or what type of apps are in the pipeline.

    (…) rich apps are the wave of the future as Web users, customers, and employees demand capabilities matching what they’ve experienced on cutting-edge sites. IT must respond, either by effectively outsourcing development or by delivering the goods itself.

    (…)

    But IT can get a lot of return from a more fluid user experience for employees, too. Many insurance companies create RIAs for their sales agents, using platforms such as Adobe Flex to create forms that make it easier to complete complex insurance applications and pass them in an industry-standard format to underwriting systems. Other companies use RIAs to deliver personalized management dashboards – the No. 1 choice when we asked what apps are in planning or development – as well as workflow and multimedia training tools.

    Data visualization is another common RIA use that can transform the productivity and creativity level of managers and knowledge workers. A telecom company might use an RIA to support engineers by providing a visual view of complex network events and possible correlations to problems. Though RIAs generally are overkill for simple Web forms and information displays, they’re particularly well suited to support complex interactions with multiple inputs and pages, large data sets, and the multimedia content seen in geospatial data or complex medical records, for example.