SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
MONTREAL JUNE 30, JULY 1ST AND 2ND 2012




Dynamic Elements
Johann Werner
NUREG GmbH
Outline


•   What are components

•   Different common types

•   Dynamic components
Components

•   reusable pieces of representation + functionality

•   WebObjects comes with many
    (e.g. WOBody, WORepetition, WOString, …)

•   Wonder adds a whole bunch
    (e.g. AjaxModalContainer, ERXLocalizedString, …)
Components
      Component API
      Code
      Template
      Binding declarations
      Info file
Standard Component


•   subclass of WOComponent

•   automatic push/pull of binding values

•   preserves state
Standard Component
Parent                                Code                                          Template

[…]                                   public class MyString extends WOComponent {   <wo:str value="$value" />
<wo:MyString value="Hello World" />   	   public String value;
[…]
                                      	   public MyString(WOContext context) {
                                      	   	   super(context);
                                      	   }
                                      }
Non-Synchronizing Component


•   manual push/pull of binding values
➡ less overhead
•   preserves state
Non-Synchronizing Component
Parent                                Code                                                       Template

[…]                                   public class MyString extends WOComponent {                <wo:str value="$value" />
<wo:MyString value="Hello World" />   	   public MyString(WOContext context) {
[…]                                   	   	    super(context);
                                      	   }

                                      	   @Override
                                      	   public boolean synchronizesVariablesWithBindings() {
                                      	   	   return false;
                                      	   }

                                      	   public String value() {
                                      	   	   return (String) valueForBinding("value");
                                      	   }
                                      }
Non-Synchronizing Component
Parent                                Code                                                       Template

[…]                                   public class MyString extends WOComponent {                <wo:str value="$^value" />
<wo:MyString value="Hello World" />   	   public MyString(WOContext context) {
[…]                                   	   	    super(context);
                                      	   }

                                      	   @Override
                                      	   public boolean synchronizesVariablesWithBindings() {
                                      	   	   return false;
                                      	   }
                                      }
Stateless Component

•   manual push/pull of binding values
➡ less overhead
•   no state

•   single shared instance*
➡ less memory, fewer Java object-creations
Stateless Component
Parent                                Code                                          Template

[…]                                   public class MyString extends WOComponent {   <wo:str value="$^value" />
<wo:MyString value="Hello World" />   	   public MyString(WOContext context) {
[…]                                   	   	    super(context);
                                      	   }

                                      	   @Override
                                      	   public boolean isStateless() {
                                      	   	   return true;
                                      	   }
                                      }
Stateless Component
Parent                                Code                                          Template

[…]                                   public class MyString extends WOComponent {   <wo:str value="$^value" />
<wo:MyString value="Hello World" />   	   private Object myVar;
[…]                                   	
                                      	   public MyString(WOContext context) {
                                      	   	    super(context);
                                      	   }

                                      	   @Override
                                      	   public boolean isStateless() {
                                      	   	   return false;
                                      	   }
                                      	
                                      	   @Override
                                          public void reset() {
                                              super.reset();
                                              myVar = null;
                                          }
                                      }
Dynamic Component
•   subclass of WODynamicElement

•   no template
➡ less memory, faster
•   direct access to bindings (WOAssociation)

•   direct access to children elements

•   must be thread-safe!
Dynamic Component
Parent                                Code

[…]                                   public class MyString extends WODynamicElement {
<wo:MyString value="Hello World" />   	   private WOAssociation value;
[…]
                                      	   public MyString(String name, NSDictionary<String, WOAssociation> associations, WOElement template) {
                                      	   	   super(name, associations, template);
                                      	   	   value = associations.get("value");
                                      	   }

                                      	   @Override
                                      	   public void appendToResponse(WOResponse response, WOContext context) {
                                      	   	   WOComponent component = context.component();
                                      	   	   response.appendContentString((String) value.valueInComponent(component));
                                      	   }
                                      }
Demo
Demo Results


•   The more specialized component class the faster it is

•   Stateless and dynamic components create less Java objects
When should I use…
Standard components

•   for pages, big blocks
Non Synchronizing components

•   smaller components that are used often

•   binding has

    •   different name as the variable to hold it

    •   no variable counterpart
When should I use…
Stateless components

 •   no state necessary

 •   memory optimization
Dynamic components

 •   no state necessary

 •   complex output generation

 •   access to child elements
Component Class Tree


                                        Object




                                    WOElement




            WODynamicElement    WOHTMLBareString   WOComponent




             WODynamicGroup       AjaxComponent    D2WComponent       ERXComponent        JSComponent




                       WOHTMLDynamic-              D2WStateless-   ERXNonSynchronizing-
AjaxDynamicElement
                          Element                   Component          Component




           WOHTMLURLValued-                                           ERXStateless-
                                        WOInput
               Element                                                 Component
Component Class Tree


                                        Object




                                    WOElement




            WODynamicElement    WOHTMLBareString   WOComponent




             WODynamicGroup       AjaxComponent    D2WComponent       ERXComponent        JSComponent




                       WOHTMLDynamic-              D2WStateless-   ERXNonSynchronizing-
AjaxDynamicElement
                          Element                   Component          Component




           WOHTMLURLValued-                                           ERXStateless-
                                        WOInput
               Element                                                 Component
Component Class Tree


                                                              Object

                ERXLoremIpsum,
                ERXWOSwitch, …
                                                          WOElement

   AjaxHighlight,
   ERXWORepetition, …
                                  WODynamicElement    WOHTMLBareString        WOComponent

AjaxHyperlink,                                            AjaxFunctionLink,
AjaxSubmitButton, …                                       ERXJavaScript, …
                                   WODynamicGroup       AjaxComponent        D2WComponent      ERXComponent        JSComponent


                                                                         WOBody,
                                             WOHTMLDynamic-
                                                                         WOFrame, …
                                                                           D2WStateless-    ERXNonSynchronizing-
                      AjaxDynamicElement
                                                Element                        Component        Component


                                                                              ERXSubmitButton,
                                 WOHTMLURLValued-
                                                              WOInput
                                                                              WOCheckBox, ERXStateless-
                                                                                           …
                                     Element                                                     Component
Component Class Tree


                                         Object




                                    WOElement




            WODynamicElement     WOHTMLBareString           WOComponent




             WODynamicGroup       AjaxComponent             D2WComponent       ERXComponent        JSComponent




                       WOHTMLDynamic-                       D2WStateless-   ERXNonSynchronizing-
ERXDynamicElement
                          Element                            Component          Component




                      WOHTMLURLValued-                                         ERXStateless-
AjaxDynamicElement                                WOInput
                          Element                                               Component
Dynamic Base Classes


•   ERXDynamicElement in ERXExtensions

•   AjaxDynamicElement in Ajax
DEMO
Creating Dynamic Element

•   extend ERXDynamicElement / AjaxDynamicElement

•   appendToResponse

    •   response.appendContentString(…)

    •   appendTagAttributeToResponse(response, name, value)

    •   appendChildrenToResponse(response, context)
Creating Dynamic Element

•   xxxValueForBinding(name, [default,] component)

•   ContextData

    •   beforeProcessing(context)

    •   afterProcessing(context)
MONTREAL JUNE 30, JULY 1ST AND 2ND 2012




Q&A

Mais conteúdo relacionado

Mais procurados

Di web tech mail (no subject)
Di web tech mail   (no subject)Di web tech mail   (no subject)
Di web tech mail (no subject)shubhamvcs
 
GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook
GR8Conf 2011: Grails 1.4 Update by Peter LedbrookGR8Conf 2011: Grails 1.4 Update by Peter Ledbrook
GR8Conf 2011: Grails 1.4 Update by Peter LedbrookGR8Conf
 
Hibernate
HibernateHibernate
Hibernateksain
 
Model Driven Software Development - Data Model Evolution
Model Driven Software Development - Data Model EvolutionModel Driven Software Development - Data Model Evolution
Model Driven Software Development - Data Model EvolutionSander Vermolen
 
2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL Spartakiade2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL SpartakiadeJohannes Hoppe
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries OverviewSiarhei Barysiuk
 
MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例Kazuhiro Oinuma
 
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterHuahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterRyu Kobayashi
 

Mais procurados (10)

Di web tech mail (no subject)
Di web tech mail   (no subject)Di web tech mail   (no subject)
Di web tech mail (no subject)
 
GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook
GR8Conf 2011: Grails 1.4 Update by Peter LedbrookGR8Conf 2011: Grails 1.4 Update by Peter Ledbrook
GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook
 
Hibernate
HibernateHibernate
Hibernate
 
Model Driven Software Development - Data Model Evolution
Model Driven Software Development - Data Model EvolutionModel Driven Software Development - Data Model Evolution
Model Driven Software Development - Data Model Evolution
 
React.js 20150828
React.js 20150828React.js 20150828
React.js 20150828
 
Email Program By Marcelo
Email Program By MarceloEmail Program By Marcelo
Email Program By Marcelo
 
2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL Spartakiade2013-03-23 - NoSQL Spartakiade
2013-03-23 - NoSQL Spartakiade
 
JavaScript Libraries Overview
JavaScript Libraries OverviewJavaScript Libraries Overview
JavaScript Libraries Overview
 
MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例MySQLでNoSQL - アメーバピグでのNoSQLの実例
MySQLでNoSQL - アメーバピグでのNoSQLの実例
 
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 WinterHuahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
Huahin Framework for Hadoop, Hadoop Conference Japan 2013 Winter
 

Semelhante a Dynamic Elements

Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency GotchasAlex Miller
 
Using Reflections and Automatic Code Generation
Using Reflections and Automatic Code GenerationUsing Reflections and Automatic Code Generation
Using Reflections and Automatic Code GenerationIvan Dolgushin
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCaelum
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritanceshatha00
 
Java design patterns
Java design patternsJava design patterns
Java design patternsShawn Brito
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityWashington Botelho
 
PVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesPVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesAndrey Karpov
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップUnity Technologies Japan K.K.
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップUnite2017Tokyo
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developementfrwebhelp
 
안드로이드 데이터 바인딩
안드로이드 데이터 바인딩안드로이드 데이터 바인딩
안드로이드 데이터 바인딩GDG Korea
 
Dependency Injection and Aspect Oriented Programming presentation
Dependency Injection and Aspect Oriented Programming presentationDependency Injection and Aspect Oriented Programming presentation
Dependency Injection and Aspect Oriented Programming presentationStephen Erdman
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and UtilitiesPramod Kumar
 

Semelhante a Dynamic Elements (20)

Java Concurrency Gotchas
Java Concurrency GotchasJava Concurrency Gotchas
Java Concurrency Gotchas
 
Using Reflections and Automatic Code Generation
Using Reflections and Automatic Code GenerationUsing Reflections and Automatic Code Generation
Using Reflections and Automatic Code Generation
 
Inheritance
InheritanceInheritance
Inheritance
 
CDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptorCDI e as ideias pro futuro do VRaptor
CDI e as ideias pro futuro do VRaptor
 
C h 04 oop_inheritance
C h 04 oop_inheritanceC h 04 oop_inheritance
C h 04 oop_inheritance
 
Java design patterns
Java design patternsJava design patterns
Java design patterns
 
Teste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrityTeste de Integração com DbUnit e jIntegrity
Teste de Integração com DbUnit e jIntegrity
 
Dynamic C#
Dynamic C# Dynamic C#
Dynamic C#
 
PVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error ExamplesPVS-Studio in 2021 - Error Examples
PVS-Studio in 2021 - Error Examples
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
 
안드로이드 데이터 바인딩
안드로이드 데이터 바인딩안드로이드 데이터 바인딩
안드로이드 데이터 바인딩
 
Dependency Injection and Aspect Oriented Programming presentation
Dependency Injection and Aspect Oriented Programming presentationDependency Injection and Aspect Oriented Programming presentation
Dependency Injection and Aspect Oriented Programming presentation
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
droidparts
droidpartsdroidparts
droidparts
 
Event recvr ss
Event recvr ssEvent recvr ss
Event recvr ss
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
 

Mais de WO Community

In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engineWO Community
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsWO Community
 
Build and deployment
Build and deploymentBuild and deployment
Build and deploymentWO Community
 
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSWO Community
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldWO Community
 
D2W Stateful Controllers
D2W Stateful ControllersD2W Stateful Controllers
D2W Stateful ControllersWO Community
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on WindowsWO Community
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnitWO Community
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache CayenneWO Community
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to WonderWO Community
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative versionWO Community
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" patternWO Community
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W WO Community
 
Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languagesWO Community
 

Mais de WO Community (20)

KAAccessControl
KAAccessControlKAAccessControl
KAAccessControl
 
In memory OLAP engine
In memory OLAP engineIn memory OLAP engine
In memory OLAP engine
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
 
Build and deployment
Build and deploymentBuild and deployment
Build and deployment
 
High availability
High availabilityHigh availability
High availability
 
Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
 
D2W Stateful Controllers
D2W Stateful ControllersD2W Stateful Controllers
D2W Stateful Controllers
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
Unit Testing with WOUnit
Unit Testing with WOUnitUnit Testing with WOUnit
Unit Testing with WOUnit
 
Life outside WO
Life outside WOLife outside WO
Life outside WO
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache Cayenne
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
iOS for ERREST
iOS for ERRESTiOS for ERREST
iOS for ERREST
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" pattern
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
 
WOver
WOverWOver
WOver
 
Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languages
 

Último

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Dynamic Elements

  • 1. MONTREAL JUNE 30, JULY 1ST AND 2ND 2012 Dynamic Elements Johann Werner NUREG GmbH
  • 2. Outline • What are components • Different common types • Dynamic components
  • 3. Components • reusable pieces of representation + functionality • WebObjects comes with many (e.g. WOBody, WORepetition, WOString, …) • Wonder adds a whole bunch (e.g. AjaxModalContainer, ERXLocalizedString, …)
  • 4. Components Component API Code Template Binding declarations Info file
  • 5. Standard Component • subclass of WOComponent • automatic push/pull of binding values • preserves state
  • 6. Standard Component Parent Code Template […] public class MyString extends WOComponent { <wo:str value="$value" /> <wo:MyString value="Hello World" /> public String value; […] public MyString(WOContext context) { super(context); } }
  • 7. Non-Synchronizing Component • manual push/pull of binding values ➡ less overhead • preserves state
  • 8. Non-Synchronizing Component Parent Code Template […] public class MyString extends WOComponent { <wo:str value="$value" /> <wo:MyString value="Hello World" /> public MyString(WOContext context) { […] super(context); } @Override public boolean synchronizesVariablesWithBindings() { return false; } public String value() { return (String) valueForBinding("value"); } }
  • 9. Non-Synchronizing Component Parent Code Template […] public class MyString extends WOComponent { <wo:str value="$^value" /> <wo:MyString value="Hello World" /> public MyString(WOContext context) { […] super(context); } @Override public boolean synchronizesVariablesWithBindings() { return false; } }
  • 10. Stateless Component • manual push/pull of binding values ➡ less overhead • no state • single shared instance* ➡ less memory, fewer Java object-creations
  • 11. Stateless Component Parent Code Template […] public class MyString extends WOComponent { <wo:str value="$^value" /> <wo:MyString value="Hello World" /> public MyString(WOContext context) { […] super(context); } @Override public boolean isStateless() { return true; } }
  • 12. Stateless Component Parent Code Template […] public class MyString extends WOComponent { <wo:str value="$^value" /> <wo:MyString value="Hello World" /> private Object myVar; […] public MyString(WOContext context) { super(context); } @Override public boolean isStateless() { return false; } @Override public void reset() { super.reset(); myVar = null; } }
  • 13. Dynamic Component • subclass of WODynamicElement • no template ➡ less memory, faster • direct access to bindings (WOAssociation) • direct access to children elements • must be thread-safe!
  • 14. Dynamic Component Parent Code […] public class MyString extends WODynamicElement { <wo:MyString value="Hello World" /> private WOAssociation value; […] public MyString(String name, NSDictionary<String, WOAssociation> associations, WOElement template) { super(name, associations, template); value = associations.get("value"); } @Override public void appendToResponse(WOResponse response, WOContext context) { WOComponent component = context.component(); response.appendContentString((String) value.valueInComponent(component)); } }
  • 15. Demo
  • 16. Demo Results • The more specialized component class the faster it is • Stateless and dynamic components create less Java objects
  • 17. When should I use… Standard components • for pages, big blocks Non Synchronizing components • smaller components that are used often • binding has • different name as the variable to hold it • no variable counterpart
  • 18. When should I use… Stateless components • no state necessary • memory optimization Dynamic components • no state necessary • complex output generation • access to child elements
  • 19. Component Class Tree Object WOElement WODynamicElement WOHTMLBareString WOComponent WODynamicGroup AjaxComponent D2WComponent ERXComponent JSComponent WOHTMLDynamic- D2WStateless- ERXNonSynchronizing- AjaxDynamicElement Element Component Component WOHTMLURLValued- ERXStateless- WOInput Element Component
  • 20. Component Class Tree Object WOElement WODynamicElement WOHTMLBareString WOComponent WODynamicGroup AjaxComponent D2WComponent ERXComponent JSComponent WOHTMLDynamic- D2WStateless- ERXNonSynchronizing- AjaxDynamicElement Element Component Component WOHTMLURLValued- ERXStateless- WOInput Element Component
  • 21. Component Class Tree Object ERXLoremIpsum, ERXWOSwitch, … WOElement AjaxHighlight, ERXWORepetition, … WODynamicElement WOHTMLBareString WOComponent AjaxHyperlink, AjaxFunctionLink, AjaxSubmitButton, … ERXJavaScript, … WODynamicGroup AjaxComponent D2WComponent ERXComponent JSComponent WOBody, WOHTMLDynamic- WOFrame, … D2WStateless- ERXNonSynchronizing- AjaxDynamicElement Element Component Component ERXSubmitButton, WOHTMLURLValued- WOInput WOCheckBox, ERXStateless- … Element Component
  • 22. Component Class Tree Object WOElement WODynamicElement WOHTMLBareString WOComponent WODynamicGroup AjaxComponent D2WComponent ERXComponent JSComponent WOHTMLDynamic- D2WStateless- ERXNonSynchronizing- ERXDynamicElement Element Component Component WOHTMLURLValued- ERXStateless- AjaxDynamicElement WOInput Element Component
  • 23. Dynamic Base Classes • ERXDynamicElement in ERXExtensions • AjaxDynamicElement in Ajax
  • 24. DEMO
  • 25. Creating Dynamic Element • extend ERXDynamicElement / AjaxDynamicElement • appendToResponse • response.appendContentString(…) • appendTagAttributeToResponse(response, name, value) • appendChildrenToResponse(response, context)
  • 26. Creating Dynamic Element • xxxValueForBinding(name, [default,] component) • ContextData • beforeProcessing(context) • afterProcessing(context)
  • 27. MONTREAL JUNE 30, JULY 1ST AND 2ND 2012 Q&A