/
You need to be really productive: You need to be really productive:

You need to be really productive: - PowerPoint Presentation

trish-goza
trish-goza . @trish-goza
Follow
343 views
Uploaded On 2019-12-17

You need to be really productive: - PPT Presentation

You need to be really productive Then Try Apache Tapestry Nikola Bogdanov May 27 15 Sofia 27052015 1 Agenda Introduction to Apache Tapestry History Philosophy and principles Structure of typical Tapestry application ID: 770798

2015 tapestry apache page tapestry 2015 page apache method components ioc application service hibernate class code pages component framework

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "You need to be really productive:" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

You need to be really productive: Then Try Apache Tapestry Nikola BogdanovMay 27 ‘15, Sofia 27/05/2015 1

Agenda Introduction to Apache TapestryHistoryPhilosophy and principlesStructure of typical Tapestry applicationMain components Service lifecycleInternal memory and page lifecycleORM integrationDisadvantages of TapestryShort Demo27/05/2015 2

Apache TapestryTapestry is an open-source frameworkThe framework is built upon the standard Java Servlet API To the application server, a Tapestry application is just a servlet filterA Tapestry application is divided into a set of pages, each constructed from components 27/05/20153

Structure of a Tapestry Application 27/05/20154

Main terminologyPages ComponentsServices 27/05/20155

Tapestry History Created by Howard Lewis Ship, adopted by the Apache Software Foundation as a top-level project in 20061.0 – 2.0v 2000-04 Developed by Howard Lewis Ship3.0v 2004 - Available under the GNU Lesser General Public License 4.0v 2006 - release under Apache, as a Jakarta sub-project5.0v 2008 POJO-based component model, new no-XML Inversion of Control5.1v 20095.2v 20105.3v 20115.3.1 – 5.3.7v 20135.3.8v 2014 Current stable version5.4 Beta 2014 Switchable jQuery/Prototype support 27/05/2015 6

Tapestry Philosophy Improves developer productivityFocus on coding, not configuring. Convention over configuration. Just store your classes in the appropriate placeTapestry framework is non-intrusive. The framework adapts to your code your classes are pure POJOsCombining pages and components with small amounts of code Non-stop development via Live-reloading featureModular and Testable, also ScalableClear error messages27/05/2015 7

Error Message Example27/05/2015 8

Notable Features Live Class Reloading Tapestry monitors changes to Page, Component and service and performs hot-swapping into the running applicationComponent-based Conventions and annotations, no xmlSpare use of HTTPSession Tapestry is highly efficient in a clustered, session-replicated environment.Post/Redirect/Get Most form submissions follow the Post/Redirect/Get (PRG) patternInversion of Control (IOC) Configurable and replaceable Tapestry is built on a lightweight IoC layerHTML based Template elements, Markup language and AJAX support27/05/2015 9

Tapestry and Maven Maven ArchetypeProject Structure 27/05/201510

Closer look into the Main Elements Pages – A Tapestry page is a duo, consisting of a Java class and a template, which may be accessed through a URL Components - Components are reusable blocks of code for a Tapestry applicationServices - Typically small and easy testable pieces of the business logicMixins - small unit of functionality used to supplement existing components with additional behaviour without changing the source code <input t:type="textfield" t:id="country" t:mixins="Autocomplete"/>Entities - Hibernate entities 27/05/2015 11

Configuration and ControlWeb.xml IoC Registry Modules 27/05/201512

IoC Registry is the central place to retrieve service 27/05/2015 13

The services are defined across multiple modules 27/05/2015 14

ModulesModule is an ordinary Java class which is used to configure the IoC RegistryThree types of modules A module class methods obey naming conventions or are annotated depending on their purpose: 1. binder method: used to define a service2. builder method: used to build a service manually3. contributor method: used to contribute to a service's configuration4. decorator method: used to intercept method invocations on a service5. advisor method: same as decorator method but is more general. 27/05/2015 15

Memory and page instances Tapestry brings true object-orientation into web application developmentStore into fields of your classes, not inside the HttpSessionTapestry maintains an in-memory cache for page instancesIf page is requested, Tapestry looks in the cache for an instance Page instance for every supported locale27/05/201516

Page / Locale matrix 27/05/2015 17

Multi-threaded environment via per-thread Maps 27/05/2015 18

Page life cycle and event handlers PageLoaded state => onPageLoaded() Active state => onActivate()Is the request loopbback?PageReset state => onPageReset()27/05/201519

Persist A persistent property’s value is persisted from one request to the nextUsually stored into the HttpSessionCould be reset using the pageReset event handler27/05/201520

Page Render & Handling form component events 27/05/2015 21

Integrating HibernateSupports Hibernate 3 and Hibernate 4Obtaining Hibernate session in pages and componentsThe Session instance created by Tapestry may be injected into a page for interaction with the database.27/05/201522

Criticism Not being backward-compatible across major versionsEarly criticisms of Tapestry 5 also mentioned documentation as a shortcoming Since version 5.0, Tapestry has bundled the Prototype and Scriptaculous JavaScript libraries27/05/2015 23

DemoReally simple example 27/05/2015 24

Books and Community on Tapestry http://jumpstart.doublenegative.com.au/home.htmlhttp://tynamo.org/ http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/users-tapestry-apache-org-Mailing-List-Archives-f2375125.htmlhttp://tapestry.apache.org/community.htmlhttp://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/ 27/05/201525

Brought to you by: 27/05/2015 26

THANK YOU :) You can find me at: nikola.k.bogdanov@gmail.com Nikola Bogdanov May 27 ’15, Sofia 27/05/2015 27