Welcome!

Java IoT Authors: Elizabeth White, Pat Romanski, Liz McMillan, Stackify Blog, Progress Blog

Related Topics: Java IoT

Java IoT: Article

Fine Grains

Choke the Client

Recently I was having a discussion with a colleague about traditional versus Web clients. Instead of hearing the usual defense about how much easier it is to deploy and manage a thin client application, his point was that client/server fails because fine-grained transactions don't work.

With a browser-based application, when collecting data the typical workflow is the user inputting data on a number of pages and completing the transaction with a final Submit button. The flow of navigation is tightly controlled by the program that may create a session EJB to capture the data entered by the user. Since all the pages that users can enter their information on are known and controlled, the session bean has knowledge of all the data it needs to collect as part of the overall process. It also has a very obvious transaction boundary with the final "Submit" request where the changes become permanent.

By contrast, a traditional client application tends to have more freestyle navigation. Users are presented with tables or lists of queried information and from there they open additional detail screens to manipulate and enter information. The problem arises because on an edit screen the values of these objects can be changed. Having confirmed this by closing the window, does this mean that the update is confirmed to the database or just locally to the JVM to be committed as part of a larger transaction? If the value is captured just in-memory, then everyplace that same object is shown to the user should also be affected, including the original list that possibly shows the name in a table column. Any additional screens that might be used to reedit the same object or show its details should also be affected by the change. This means that the object must be uniquely identified within the Java program, so some kind of single instance management is required.

What if during the transaction the user performs another object query? The user could expect this to be a mixture of persistent data merged with any local changes he or she has made (as yet uncommitted). Including uncommitted newly created objects in the list is difficult as these must be woven between the persistent ones at the correct sort order positions. The problem is further compounded by the fact that within an overall transaction in freestyle GUI entry mode, the user might launch another multiscreen process to enter a new code and then decide not to commit this on the final screen. Alternatively, if the user does decide to commit this second process, it should be confirmed only into the world in which the original (still yet uncommitted) objects live. Nested transactions are required to support this, and apart from being very tricky to program, they are arguably confusing to the user as to which parts of the data are persistent and which aren't.

The following are two solutions that can be employed.

First, use a persistence framework. Several good ones exist such as Cocobase, TopLink, or Solarmetric. If you want, you can always roll your own framework, although be warned it's a tough task to undertake. The danger is that you'll spend too many cycles building your killer framework and fall easily into the trap (as I once did in a previous life) of spending too long polishing your silver bullet while losing focus on the real business problem you're trying to solve.

The second solution is the one that I find that in my older years I tend to use more and more: solve a problem by avoiding it. The freestyle mode of client GUIs works well for navigation, but for data entry it keeps the user down a specific path. This is essentially what wizards do with their back and next buttons and a final "Finish" page, and it's obvious to the user that by not confirming, the final screen loses the whole process; and since it's modal there is no danger of having to merge objects into ones that are read freshly from the persistent back end.

What is interesting about adopting a wizard or a rigid or modal dialog style of data entry is that this is essentially what a browser does. Instead of the server dealing with atomic and essentially unpredictable requests for data updates, the scope of what is being changed is predetermined and known to the session. It is an easier programming model to deal with, and the fact that the browser does it well doesn't mean that traditional GUIs can't adopt it as well. There is still a large functional value that results from giving the user a client that can perform local validation and has the high usability function point that client windows offer; however, there is also a lot to be said for simplifying the input programming model to be based around a constrained workflow.

Several years ago I was with a customer who was building an entire client application framework in Swing that was being specifically designed to emulate a browser (complete with back and forward buttons). The customer's argument was that their users were comfortable with the browser. While I originally dismissed their project as dumbing down the power of what a proper GUI could do, I think there's a lot to be learned by looking at the mechanics of how a browser-based application does its persistence and using this session-based programming model for more traditional clients.

Resources

  • Cocobase: www.thoughtinc.com
  • Solarmetric: www.solarmetric.com
  • More Stories By Joe Winchester

    Joe Winchester, Editor-in-Chief of Java Developer's Journal, was formerly JDJ's longtime Desktop Technologies Editor and is a software developer working on development tools for IBM in Hursley, UK.

    Comments (2) View Comments

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    Most Recent Comments
    Busy retail developer 04/08/04 09:16:48 AM EDT

    I personally detest modal dialogs, especially when modal dialogs are open and you can''t move all the modal windows/dialogs out of the way, to see required information, I think most modal dialogs are unnecessary and influence by laziness, tradition etc. not by requirements and usability.

    You are also wrong about web pages, you can easily have non-modal dialogs, by using pop-up pages, I''ve found few cases where modal dialogs were really required.

    Mihai Streinu 04/07/04 06:31:18 AM EDT

    This is not about technology at all.
    Whatever is best for the particular business process, that is what must be built.
    To generalize, saying that wizard-style interfaces are always best for data entry, is perhaps akin to ignore the finer points of just what kind of "data entry" and "transactions" we''re talking about.
    Take example of insurance claims: the basic transaction is to save the new information into a new claim registration. However, during this a claim processor needs to
    - check at some point that a policy is in force (aha, perhaps a new tab on the UI) and that its terms and conditions match the claim
    - check at another point that premium payments are up-to-date (yet another tab to open in the UI, so that the payment history is visible)
    - update at another point the customer data, perhaps even to record a complaint (one or two new tabs to open?)

    Driving such a process through a succession of modal-only wizard windows drives claim processor nuts. I know because I''ve seen them in real life, operating both kinds of UIs. The ones that have a multi-window/tab environment are much happier.

    My .02 euro on this one.

    Regards,
    Mihai

    @ThingsExpo Stories
    SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
    SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp em...
    Real IoT production deployments running at scale are collecting sensor data from hundreds / thousands / millions of devices. The goal is to take business-critical actions on the real-time data and find insights from stored datasets. In his session at @ThingsExpo, John Walicki, Watson IoT Developer Advocate at IBM Cloud, will provide a fast-paced developer journey that follows the IoT sensor data from generation, to edge gateway, to edge analytics, to encryption, to the IBM Bluemix cloud, to Wa...
    There is huge complexity in implementing a successful digital business that requires efficient on-premise and cloud back-end infrastructure, IT and Internet of Things (IoT) data, analytics, Machine Learning, Artificial Intelligence (AI) and Digital Applications. In the data center alone, there are physical and virtual infrastructures, multiple operating systems, multiple applications and new and emerging business and technological paradigms such as cloud computing and XaaS. And then there are pe...
    SYS-CON Events announced today that B2Cloud will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. B2Cloud specializes in IoT devices for preventive and predictive maintenance in any kind of equipment retrieving data like Energy consumption, working time, temperature, humidity, pressure, etc.
    DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...
    SYS-CON Events announced today that Suzuki Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Suzuki Inc. is a semiconductor-related business, including sales of consuming parts, parts repair, and maintenance for semiconductor manufacturing machines, etc. It is also a health care business providing experimental research for...
    SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
    SYS-CON Events announced today that Fusic will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Fusic Co. provides mocks as virtual IoT devices. You can customize mocks, and get any amount of data at any time in your test. For more information, visit https://fusic.co.jp/english/.
    SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
    SYS-CON Events announced today that Keisoku Research Consultant Co. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Keisoku Research Consultant, Co. offers research and consulting in a wide range of civil engineering-related fields from information construction to preservation of cultural properties. For more information, vi...
    SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
    SYS-CON Events announced today that Interface Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Interface Corporation is a company developing, manufacturing and marketing high quality and wide variety of industrial computers and interface modules such as PCIs and PCI express. For more information, visit http://www.i...
    SYS-CON Events announced today that Mobile Create USA will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Mobile Create USA Inc. is an MVNO-based business model that uses portable communication devices and cellular-based infrastructure in the development, sales, operation and mobile communications systems incorporating GPS capabi...
    In his session at @ThingsExpo, Greg Gorman is the Director, IoT Developer Ecosystem, Watson IoT, will provide a short tutorial on Node-RED, a Node.js-based programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using a wide range of nodes in the palette that can be deployed to its runtime in a single-click. There is a large library of contributed nodes that help so...
    Elon Musk is among the notable industry figures who worries about the power of AI to destroy rather than help society. Mark Zuckerberg, on the other hand, embraces all that is going on. AI is most powerful when deployed across the vast networks being built for Internets of Things in the manufacturing, transportation and logistics, retail, healthcare, government and other sectors. Is AI transforming IoT for the good or the bad? Do we need to worry about its potential destructive power? Or will we...
    SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
    SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
    SYS-CON Events announced today that SIGMA Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. uLaser flow inspection device from the Japanese top share to Global Standard! Then, make the best use of data to flip to next page. For more information, visit http://www.sigma-k.co.jp/en/.
    With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.