Spring IO 2012: The Walking Dead - Desktop Applications with Spring RCP

Post on 17-Aug-2015

23 views 2 download

Tags:

Transcript of Spring IO 2012: The Walking Dead - Desktop Applications with Spring RCP

The Walking Dead: Aplicaciones de Escritorio con Spring

Julio ArgüelloDirector of Software Architecture @B2B2000

@julioarguellohttp://es.linkedin.com/in/julioarguello

Table Of Contents

• Why “The Walking Dead” ?!?!• Full Cast• A Brief History• Architecture• The Big Deal• Prototyping• How To• Related Links

WALKING DEAD

THE

Why “The Walking Dead” ?!?!

http://java.dzone.com/why-desktop-not-webapphttps://blogs.oracle.com/geertjan/entry/james_gosling_the_massive_popularity

Is Desktop Really Dead?

Full CastWho is who?

Full Cast [Main Character]• Should we dance… (…Swing)? Rick Grimes as

Our Client!!

Full Cast [Co-Star]• …Together? Lori Grimes as

B2B 2000!!

Full Cast [Special Guest Artist]• …And a Child was Born Carl Grimes as

Bluebell!!

Full Cast [Supporting Actors]• And the Context The Walkers as

$!%&%!$!!

A Brief History

Leyenda

Gestión AcadémicaRecursos HumanosGestión Económica

RegistroGestión

Investigación

Portal Corporativo

Seguimiento de Cursos de Extensión Universitaria

Inventario de patrimonio

Telefonía

AulaNETBiblioteca Uniovi Directo Tarjeta Inteligente

Gestión Identidades

LDAP Corporativo

Active Directory

Correo Corporativo

Functional and technological Context

A Brief History [The Recipe]

Ingredients:J2SE 5.0JPA 1.0 (Hibernate)Spring FrameworkWAS 6Informix

A Brief History [The Holy Book]

A Brief History [The Infrastructure]

A Brief History [The Team]

ArchitectureBasic Architecture Concepts

Architecture [Bottom-Up]

• Data Access Layer– JpaGenericDao (over Hibernate)– Package DAO’s

Architecture [Service Layer]

POJOTRANSA

CTIONAL

CACHEDSECURED

REMOTE

CUSTOM ASP

ECT DynamicProxyProxy#DoAction

1. DoBefore2. RealSubject#DoAction3. DoAfter

Architecture [Service Layer]

Architecture [Service Layer]

Architecture [Remote Services]

Julio Alberto Argüello Fernández
TODOInsertar bean de como se exponen los servicios

Architecture [Remote Services]

• Server Side

• Clent Side

Architecture [Spring HTTP Invoker]

The Big DealDesktop or not Desktop?

The Big Deal [What?]

We want a Desktop client!!

OK, let’s use both Desktop and Web Clients

The Big Deal [2006] [Why?]

↓↓ Few Plugins

↓ Inmature

↓↓↓ Hard To Learn

↓↓↓↓ Unreal

↓↓↓↓↓ Privative

↓↓↓↓↓↓ Heterogeneus

The Big Deal [The Winner]• Why Spring RCP?• Provide a way to build

structured, highly-configurable, GUI-standards-following Swing applications faster by leveraging the Spring Framework

• Foster integration with existing rich-client-related projects where it make sense. For example, jgoodies-forms and TableLayout are two good layout managers. We don't need to develop another one.

• Adhere to the principles set forth by the Spring Framework programming to interfaces; the importance of sound OO design, documentation, and testing.

PrototypingHow looks like?

Prototyping [Balsamiq Mockups]

Prototyping [Initial Look]

Prototyping [Current Look]

<Demo />

How ToThe key concepts of our child

How To [Key Spring RCP Features]• Almost everything are beans• Swing programming without knowing Swing• Command ‘framework’• Form data binding• Based on Eclipse concepts (Perspective, view)• I18n, validation, support classes, icon and image

abstraction…• Out of the box integrations:

– JGoodies– Acegi/Spring Security– Hibernate Validator– …

http://netbeans.dzone.com/news/spring-rcp-tutorial

How To [Bluebell Improvements]1. Easier configuration (CoC)2. Module based approach3. Out of the box scaffolding and new commands4. Non intrusive: prefers ‘extensions’ and ‘aspects’

over ‘patches’ – Enable to migrate from current installations!!

5. Modern look’n feel6. Bug fixes and utility classes7. Testing ‘framework’8. Spring 3 and Maven 39. Integrations10. Multiple deployment models11. Performance improvements

How To [1. Easier Config. - CoC]• Maven artifacts• Main class

org.bluebell.richclient.application.RcpMain

• Separation of concerns (application contexts)– Startup: Defines the splash screen, but could define anything that

you want to have happen specifically at startup

– Richclient: Configures the Spring RCPcomponents and services.

– Command: Provides the application's commands, organized within menu bars and toolbars, and the items within them

• Shared Beans

How To [1. Easier Config. - CoC]

How To [2. Module Based Approach]Your App

How To [2. Module Based Approach]

Resolved Value Parent PPC + Priority Order

How To [3. Scaffolding]

How To [3. Scaffolding]

How To [3. Scaffolding] class form

T:extends Object

AbstractBbChildForm

AbstractMasterFormApplicationWindowAware

T:extends Object

AbstractBbMasterForm

T:extends ObjectU:extends Object

AbstractBbSearchForm

ApplicationWindowAware

T:extends Object

AbstractBbTableMasterForm

ApplicationWindowAware

ApplicationWindowAwareForm

BbConsoleForm

AbstractDetailForm

T

BbDispatcherForm{leaf}

T

BbValidationForm

«interface»GlobalCommandsAccessor

Form

AbstractForm

*

How To [3. Scaffolding]

How To [3. Scaffolding]

Form Builderhttp://www.jgoodies.com/articles/forms.pdf

How To [4. Non Intrusive Approach]

• AOP– org.bluebell.richclient.application.support.ApplicationPageConfigurerAspect– org.bluebell.richclient.application.support.ApplicationWindowAspect

• Newer implementations– org.bluebell.richclient.command.config.BbToolBarCommandButtonConfigurer– org.bluebell.richclient.factory.ComponentFactoryDecorator– org.bluebell.richclient.form.util.BbHibernateRulesValidator– org.bluebell.richclient.components.jideoss.JideOssComponentFactory– org.bluebell.richclient.form.binding.jideoss.JideBindingFactory– org.bluebell.richclient.application.config.substance.SubstanceLookAndFeelConfigurer– org.bluebell.richclient.application.docking.vldocking.substance.SubstanceDockableCo

ntainerFactory– org.bluebell.richclient.components.substance.SubstanceComponentFactory– org.bluebell.richclient.components.swingx.SwingxComponentFactory– org.bluebell.richclient.application.config.vldocking.VLDockingLookAndFeelConfigurer– org.bluebell.richclient.application.docking.vldocking.BbVLDockingApplicationPageFac

tory

• Modularization Approach and so on…

How To [5. Look’n Feel]

How To [5. Look’n Feel]

How To [5. Look’n Feel]

How To [5. Look’n Feel]

How To [6.Bug Fixes and Utilities]

• Bug Fixes– Type Converters– org.bluebell.richclient.form.util.BbDefaultFormModel– org.bluebell.richclient.application.config.substance.SubstanceLookAndFeelConfigurer– org.bluebell.richclient.application.docking.vldocking.substance.SubstanceDockableCo

ntainerFactory– org.bluebell.richclient.application.docking.vldocking.ui.BbDockViewTitleBarUI– org.bluebell.richclient.application.docking.vldocking.ui.BbFocusHighlighter

• Utils– org.bluebell.richclient.application.support.ApplicationUtils– org.bluebell.richclient.command.support.CommandUtils– org.bluebell.richclient.form.builder.support.DirtyTrackingUtils– org.bluebell.richclient.form.FormUtils– org.bluebell.richclient.util.GlazedListsUtils– org.bluebell.richclient.util.ObjectUtils– org.bluebell.richclient.swing.util.SwingUtils– org.bluebell.richclient.table.support.TableUtils– org.bluebell.richclient.application.docking.vldocking.VLDockingUtils

How To [7. Testing] class Testing

AbstractJUnit4SpringContextTests

AbstractBbRichClientTests

AbstractBbSamplesTests

AbstractBbSamplesTests

TestApplicationUtils

TestApplicationWindowAspect

TestApplicationWindowAspectWithinSubstance

TestApplicationWindowAspectWithinVLDocking

TestBbDispatcherForm

TestBbVLDockingApplicationPage

TestDefaultApplicationPageConfigurer

TestMockAbstractBbTableMasterForm

TestMultipleValidationResultsReporter

TestStressOnAbstractBbTableMasterForm

TestTabbedApplicationWindowFactory

TestVLDockingBeanPostProcessor

<Demo />

How To [8. Spring 3 and Maven 3]

How To [9. Integrations]

• Jide OSS Components• SwingX Components• Automatic VLDocking layout with Velocit Engine• Substance Look’n Feel• Coquette Icon Set

How To [10. Deployment]

• Maven Exec Plugin

• JWS (on GAE)• Applet (not tested yet in production envs.)• Even with JUnit!!

How To [10. Deployment]

• http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6533653

• JAR packaging, signing and compress out of the box (Maven + ANT) [Hard work!!]– org.codehaus.mojo.webstart::webstart-maven-plugin– org.codehaus.mojo::keytool-maven-plugin– org.apache.maven.plugins::maven-antrun-plugin– org.codehaus.mojo.webstart::webstart-pack200-anttasks– org.codehaus.mojo.webstart::webstart-jnlp-servlet

How To [10. Deployment]

How To [11. Performance]

• http://docs.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/pack200.html

Pack200 + GZIP

Related Links• http://jirabluebell.b2b2000.com/browse/BLUE• http://saber.b2b2000.com/display/BLUE/Bluebell• http://code.google.com/p/bluebell/• http://bluebell.googlecode.com/svn/www/index.html• http://www.springsource.org/spring-rcp• https://gitorious.org/valkyrie-rcp

Q&A