Top Banner
Building Software using Rich Clients Platforms Rikard Thulin
51

Building software using Rich Clients Platforms Rikard Thulin

Apr 11, 2017

Download

Documents

Rikard Thulin
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building software using Rich Clients Platforms Rikard Thulin

Building Softwareusing

Rich Clients Platforms

Rikard Thulin

Page 2: Building software using Rich Clients Platforms Rikard Thulin

Speakers Profile

Senior Consultant & Java Evangelist

Co-leader for Gothenburg's Java User Group, Javaforum

rikard (at) thulin.pp.se

Page 3: Building software using Rich Clients Platforms Rikard Thulin

Agenda• The needs of an advanced rich client

• Why we need Application Architecture

• Available Rich Client Frameworks

• Demo

• Real world experience

• Conclusions

• Q & A

Page 4: Building software using Rich Clients Platforms Rikard Thulin

Local vs Web applicationLocal app

(RCP based)Web app

Deployment Automatic updates, clients can have difference versons

Clients are always updated and in sync

UI Components

Very rich and matureFancy but not mature,

usability is low

Performance Very high, latency problems can be reduced

Slow

Time to develop

Depends on skill set Depends on skill set

Market Small The whole world

Page 5: Building software using Rich Clients Platforms Rikard Thulin

The needs

• Time-to-market

• Focus on business logic

• Usability

• Flexible deployment and distribution

• Solve the application architecture problem

Page 6: Building software using Rich Clients Platforms Rikard Thulin

Time-to-market

• Requires initial investment

• Hurts TTM in short term

• Huge decrease in mid to long term

• RCP might not be the best choice for simple applications

Page 7: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logicWhat the heck is this?

Page 8: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logicWhat the heck is this?

Page 9: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logicWhat the heck is this?

Page 10: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logicWhat the heck is this?

Page 11: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logic

• Today - no one needs to write their own web framework

• Today - no one needs to not write their own Rich Client application framework

• Instead of doing lots (ant lots) of UI infrastructure - do real business value

Page 12: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logic

• Most applications need some kind of infrastructure to handle things such as

• actions, menus, keyboard shortcuts, window management, state, etc

• Swing/SWT does not address this - at the end of the day they are just widget libraries

Page 13: Building software using Rich Clients Platforms Rikard Thulin

Focus on business logic

• The RCP allows you to focus on the business - not the UI infrastructure

• True also for web applications as well (no one writes plain JSP)

Page 14: Building software using Rich Clients Platforms Rikard Thulin

Usability

• Application level usability comes for free

• Man years of usability out-of-the box

• The RCP helps you with lower level usability as well

• Lower level usability is pretty much up to you to get right

Page 15: Building software using Rich Clients Platforms Rikard Thulin

Usability

• To demonstrate usability

• First an RCP based dialog will be presented

• Second a non RCP based dialog will be presented

• Try to figure out the five usability things addressed by the RCP version

Page 16: Building software using Rich Clients Platforms Rikard Thulin

UsabilityDialog implemented using an RCP

Page 17: Building software using Rich Clients Platforms Rikard Thulin

UsabilityThe same dialog implemented without an RCP

Page 18: Building software using Rich Clients Platforms Rikard Thulin

Usability

Did you find fiveusability issues addressed

by the RCP?

Page 19: Building software using Rich Clients Platforms Rikard Thulin

Usability

RCP Non RCP

Side by side comparison

Page 20: Building software using Rich Clients Platforms Rikard Thulin

Usability

Page 21: Building software using Rich Clients Platforms Rikard Thulin

Usability

Default button

Page 22: Building software using Rich Clients Platforms Rikard Thulin

Usability

Default button

Escape closes the dialog

Page 23: Building software using Rich Clients Platforms Rikard Thulin

Usability

Default button

Build in support for help

Escape closes the dialog

Page 24: Building software using Rich Clients Platforms Rikard Thulin

Usability

Default button

Build in support for help

Escape closes the dialog

Correct spacing

Page 25: Building software using Rich Clients Platforms Rikard Thulin

Usability

Default button

Build in support for help

Escape closes the dialog

Correct spacing

Correct size

Page 26: Building software using Rich Clients Platforms Rikard Thulin

Application architecture

• An application is divided into modules/plugins/bundles

• Plugins declares their dependencies

• Plugins publish API:s and hide internal code

• Plugins are loosely coupled

• Plugins execute in a runtime container

Page 27: Building software using Rich Clients Platforms Rikard Thulin

• A modular system does not prevent bad coding practices

• But it encourages good coding practices

• Bad code is isolated to one modules and not spread across the whole application

Application architecture

Page 28: Building software using Rich Clients Platforms Rikard Thulin

• The UI infrastructure to build applications

• Higher level components such as

• Wizards, User Settings, Data Access framework

• Windowing System

• And much more...

Application architecture

Page 29: Building software using Rich Clients Platforms Rikard Thulin

Flexible deployment and distribution

• Big releases can be deployed as usual

• Parts of the application (a plugin) can be updated and distributed individually

• New features can be released in between big releases

• Much more agile approach to releasing software

Page 30: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

• Swing Application Framework (JSR-296)

• Spring Rich Client

• JGoodies Swing Suite

• Eclipse RCP

• Netbeans RCP

Page 31: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 32: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 33: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 34: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 35: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 36: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 37: Building software using Rich Clients Platforms Rikard Thulin

Available Frameworks

Less

Better

FeaturesLearning CurveMaturityCommunity

Page 38: Building software using Rich Clients Platforms Rikard Thulin

Eclipse RCP

• OSGi based container (Equinox)

• Manage dependencies and lifecycle

• Explicitly supports dynamic scenarios

• Highly adopted standard

• OSGi Bundle is the unit of modularization

Page 39: Building software using Rich Clients Platforms Rikard Thulin

Eclipse RCP

• Based on SWT, native look-and-feel

• Swing component can be embedded

• Requires Eclipse IDE to build (*)

• It is possible to run two or more versions of the same module in one application

Page 40: Building software using Rich Clients Platforms Rikard Thulin

Netbeans RCP

• Proprietary runtime based on Java Extension Mechanism

• Manage dependencies and lifecycle

• NetBeans module is the unit of modularization

• Soon to support OSGi bundles

Page 41: Building software using Rich Clients Platforms Rikard Thulin

Netbeans RCP

• Built using Ant or Maven, no IDE lockin (*)

• Java Webstart deployment out of the box

• It is possible to run two or more versions of the same module in one application

• Based on Swing

Page 42: Building software using Rich Clients Platforms Rikard Thulin

But Swing is slow...

The performance of Swing is (for years) not an issue!

“the only problem with Swing is that there are a limited number of higher-level abstractions available that assist in making the toolkit simpler and easier to use” - The Spring Rich Client Team

Page 43: Building software using Rich Clients Platforms Rikard Thulin

Licensing

• Eclipse RCP

• Eclipse Public License (EPL)

• Netbeans RCP

• Common Development and Distribution License (CDDL)

• GPLv2 with Classpath Exception

Page 44: Building software using Rich Clients Platforms Rikard Thulin

DEMO

• Creating a Netbeans RCP based “Hello World” application using Maven

• No dependency to NetBeans IDE

• Start with a empty directory

• Not pre-cooked in any way (*)

Page 45: Building software using Rich Clients Platforms Rikard Thulin

DEMO(this page if for reference purpose only)

• mvn -DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=netbeans-platform-app-archetype -DarchetypeVersion=1.2 -DarchetypeRepository=http://repo1.maven.org/maven2 archetype:generate

• cd <directory>

• mvn install

• cd application

• mvn nbm:run-platform

Page 46: Building software using Rich Clients Platforms Rikard Thulin

Real world experience using Netbeans RCP

• Requires initial investment

• Great community, books, tutorials

• Modularity is complex

• Unit Testing without the runtime

• The usual suspects will haunt you

• Java Help, Java WebStart, Maven

Page 47: Building software using Rich Clients Platforms Rikard Thulin

Real world experience using Netbeans RCP

• We estimated the cost not to use an RCP to $30K

• The UI quality would have been significant less

Page 48: Building software using Rich Clients Platforms Rikard Thulin

Conclusion

• For small applications the initial investment could be to high

• What is most important for you?

• Can you reuse plugins from the community

• SWT or Swing

• OSGi or not

• Build using Eclipse or Maven / Ant

Page 49: Building software using Rich Clients Platforms Rikard Thulin

Conclusion

There is no need toreinvent the wheel

by writing UI infrastructure code

Page 50: Building software using Rich Clients Platforms Rikard Thulin

Conclusion

- or -

Whatever you choose, it is much, much better than what you could achieve

yourself

Page 51: Building software using Rich Clients Platforms Rikard Thulin

Q & A