510 likes | 1.03k Views
Enterprise Vaadin. Vaadin7 in the enterprise world. Dominik Dorn Vienna University of Technology Research Group for Industrial Software (INSO). Dominik Dorn Researcher & Software Engineer JUG leader, Open Source and productivity guy ...always trying out the “new&cool” stuff. About me.
E N D
Enterprise Vaadin Vaadin7 in the enterprise world. Dominik Dorn Vienna University of Technology Research Group for Industrial Software (INSO)
Dominik Dorn Researcher & Software Engineer JUG leader, Open Source and productivity guy...always trying out the “new&cool” stuff... About me...
Creating scalable “desktop like” enterprise web-apps is hard :/ … in my opinion …
it is especially hard to... ...create a consistent, accessible and functionalUser Interface & User eXperience … in my opinion …
it is hard to... ...create web-based “rich clients” that allow to scale to a lot of concurrent users. … in my opinion …
It is hard to... ...scale over multiple development teams at once to concurrently work on finishing user stories … in my opinion …
Vaadin7helps us to solve ([some|most] of) these problems … in my opinion …
The case-study • Austrian government agency • Multiple concurrent “releases” with different scopes of functionality • Tight schedule & multiple (development) teams • Some handicapped (visual impaired) users • > 5k concurrent users • Clustered environments • Deployment on IBM WAS 8 • Development on TomEE 1.5.2
The task Allow for a high level of concurrent development Provide a great user experience Keep the code base well structured, maintainable & testable Scale to more than 5000 concurrent users
5 steps proven practices to success ...that worked quite well for us....
Create UI & UX mockups Step 1 - UI
Step 1 - UI Keep in mind: - try to create a (more or less) stateless webapp - work with the people that will use the app (req. eng.) - focus on functionality & usability first → no pixel shifting
Step 1 - UI Tools Balsamiq mockups → User stories → Developer TasksPhotoshop → CSS/SCSS (IntelliJ / Firebug)
Keep your code base clean & structured by grouping functionality common use cases, releases and business entities Step 2 – code structure / architecture
Step 2 – build architecture • Maven 3 based project • Common & base functionality: core • Helpers: util • Subprojects: → be, api, fe, fe-submodules • Parent projects for be, api, fe → declaring common properties, dependencies, plugins, etc.
multi module architecture Step 2
Keep your code clean, well structured and testable by applyingthe MVP Design Pattern & TDD using Mockito & JUnit/TestNG Step 3 – maintainability
Step 3 – maintainability – Model-View-Presenter <T extends AbstractPresenter> <T extends AbstractView>
1st Rule: Keep your sessions thin!!!! Step 4 – scalability / clustering
Session gets huge quickly: ~700KB ~> 3.5MB ~> 15MB Delta Replication broken (Tomcat/WAS) → Full Replication req. Pluggable Session Storage in the works (Vaadin #9782) (also see: http://stackoverflow.com/questions/14797535/memory-footprint-for-large-systems-in-vaadin ) Step 4 – scalability / clustering
3 recommendations 1. Use stateless views with Class based Navigator (where possible) 2. Load data into the components when they are attached to a visible component. Override the components .attach() method 3. Remove data from components when they are not used in the visible part of the UI anymore. Override the components .detach() method. (also see: http://stackoverflow.com/questions/8464337/managing-large-sessions-using-gae-and-vaadin ) Step 4 – scalability / clustering
Leverage JavaEE 6/7 to be more productive! Step 5 – Productivity – JavaEE
Use CDI & EJBsfor Dependency Injection & Transaction handling Step 5 – Productivity – JavaEE
Step 5 – Productivity – JavaEE: JMS & Vaadin @Push JMS Producer inspired by Antonio Goncalves http://antoniogoncalves.org/2011/09/25/injection-with-cdi-part-iii/
Productivity enhancers – JRebel reloads classes → fast development cycles → Saves HOURS of work-time! Integration for CDI, Vaadin + Vaadin-CDI, TomEE, Glassfish, etc. Comes bundled with Vaadin Pro Edition.
Built on Selenium Includes special support for Vaadin → saves time!( including PhantomJS ) Commercial add-on: Single License or Pro Account Productivity enhancers – TestBench
Productivity enhancers – TestBench Support for JBehave built-in! Meta: Search Customer by social security number Story: As a user, the following is given I want to load a page, so I can search for a Customer by ssn Scenario: The user opens the page and sees an empty result list A search page for the user 02t0801 is given If I do nothing Then I see in the “info label” the following text: 'Please enter search criteria.'
Productivity enhancers – TestBench Support for JBehave built-in! Meta: VSNR Suche Erzählung: Als Benutzer gilt folgendes für mich Ich möchte die Seite laden können, damit ich nach VSNR suchen kann. Szenario: Der User öffnet die Seite und sieht eine leere Ergebnisliste Gegeben sei eine laufende Beauskunftungsseite fuer den User 02t0801 Wenn ich nichts tue Dann sehe ich im Info Label folgenden Text: 'Führen Sie bitte eine Suche durch.'
Productivity enhancers – TomEE Maven Plg & “provided” <build>... <plugin> <groupId>org.apache.openejb.maven</groupId> <artifactId>tomee-maven-plugin</artifactId> <version>1.0.0</version> <configuration> <tomeeVersion>1.5.2</tomeeVersion> <libs> <lib>com.vaadin:vaadin-server:${vaadin.version}</lib> … </libs> …. mvn clean package tomee:run
Recap • Requirements analysis • Mockups → User Stories • TestBench tests • Structure your code • Submodules, Backend / Frontend separation • MVP & TDD, CDI/DeltaSpike • Keep it scalable • Thin sessions, Class-based views • Iterate fast • JRebel, TestBench, TomEE Maven Plugin
Credits Help with CDI Mark @Struberg Marcus Büttner Help with Sessions Christoph Ledl Ronald Steininger Help with TestBenchDaniel Jahre @daja77 Code structure / Architecture Thomas Artner @StroblStefan