Soumettre la recherche
Mettre en ligne
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
•
Télécharger en tant que ODP, PDF
•
0 j'aime
•
498 vues
John Dalsgaard
Suivre
Technologie
Signaler
Partager
Signaler
Partager
1 sur 36
Télécharger maintenant
Recommandé
SQL212.1 Introduction to SQL using Oracle Module 1
SQL212.1 Introduction to SQL using Oracle Module 1
Dan D'Urso
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
iFour Technolab Pvt. Ltd.
Core Java Programming Language (JSE) : Chapter XIII - JDBC
Core Java Programming Language (JSE) : Chapter XIII - JDBC
WebStackAcademy
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
UA Mobile
おかあさんとgit
おかあさんとgit
manaten
Искусство врачевания (ко дню медицинского работника)
Искусство врачевания (ко дню медицинского работника)
Library of Lugansk State Medical University
Infographics
Infographics
Lisa Jackson
Modernisering af IBM Domino applikationer for Common Denmark
Modernisering af IBM Domino applikationer for Common Denmark
John Dalsgaard
Recommandé
SQL212.1 Introduction to SQL using Oracle Module 1
SQL212.1 Introduction to SQL using Oracle Module 1
Dan D'Urso
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
iFour Technolab Pvt. Ltd.
Core Java Programming Language (JSE) : Chapter XIII - JDBC
Core Java Programming Language (JSE) : Chapter XIII - JDBC
WebStackAcademy
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
MVVM with Databinding and Google's new ViewModel. UA Mobile 2017.
UA Mobile
おかあさんとgit
おかあさんとgit
manaten
Искусство врачевания (ко дню медицинского работника)
Искусство врачевания (ко дню медицинского работника)
Library of Lugansk State Medical University
Infographics
Infographics
Lisa Jackson
Modernisering af IBM Domino applikationer for Common Denmark
Modernisering af IBM Domino applikationer for Common Denmark
John Dalsgaard
Их судьбы война рифмовала...
Их судьбы война рифмовала...
Library of Lugansk State Medical University
Целители тел и душ
Целители тел и душ
Library of Lugansk State Medical University
正規表現で作るワンライナーライフゲーム
正規表現で作るワンライナーライフゲーム
manaten
RESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWork
John Dalsgaard
Хранители мудрости
Хранители мудрости
Library of Lugansk State Medical University
Душа веков - Шекспир
Душа веков - Шекспир
Library of Lugansk State Medical University
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
John Dalsgaard
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
John Dalsgaard
IBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino Roadmap
Teamstudio
ドッターのためのプログラミングなにそれおいしいの
ドッターのためのプログラミングなにそれおいしいの
manaten
zshという選択肢
zshという選択肢
manaten
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
John Dalsgaard
Data Analytics with DBMS
Data Analytics with DBMS
GLC Networks
Master Data Services - used for than just data
Master Data Services - used for than just data
Kenneth Michael Nielsen
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
Getting value from IoT, Integration and Data Analytics
Fundaments of Knockout js
Fundaments of Knockout js
Flavius-Radu Demian
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
MrSameerSTathare
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
Sandro Mancuso
Cloud Computing & Cloud Storage
Cloud Computing & Cloud Storage
Priyesh Pratap Singh
Introduction to mongo db
Introduction to mongo db
Lawrence Mwai
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
Vlad Fedosov
Contenu connexe
En vedette
Их судьбы война рифмовала...
Их судьбы война рифмовала...
Library of Lugansk State Medical University
Целители тел и душ
Целители тел и душ
Library of Lugansk State Medical University
正規表現で作るワンライナーライフゲーム
正規表現で作るワンライナーライフゲーム
manaten
RESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWork
John Dalsgaard
Хранители мудрости
Хранители мудрости
Library of Lugansk State Medical University
Душа веков - Шекспир
Душа веков - Шекспир
Library of Lugansk State Medical University
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
John Dalsgaard
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
John Dalsgaard
IBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino Roadmap
Teamstudio
ドッターのためのプログラミングなにそれおいしいの
ドッターのためのプログラミングなにそれおいしいの
manaten
zshという選択肢
zshという選択肢
manaten
En vedette
(11)
Их судьбы война рифмовала...
Их судьбы война рифмовала...
Целители тел и душ
Целители тел и душ
正規表現で作るワンライナーライフゲーム
正規表現で作るワンライナーライフゲーム
RESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWork
Хранители мудрости
Хранители мудрости
Душа веков - Шекспир
Душа веков - Шекспир
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
RESTful services on IBM Domino/XWork (ICON UK 21-22 Sept. 2015)
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
REST services and IBM Domino/XWork - DanNotes 19-20. november 2014
IBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino Roadmap
ドッターのためのプログラミングなにそれおいしいの
ドッターのためのプログラミングなにそれおいしいの
zshという選択肢
zshという選択肢
Similaire à MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
John Dalsgaard
Data Analytics with DBMS
Data Analytics with DBMS
GLC Networks
Master Data Services - used for than just data
Master Data Services - used for than just data
Kenneth Michael Nielsen
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
Getting value from IoT, Integration and Data Analytics
Fundaments of Knockout js
Fundaments of Knockout js
Flavius-Radu Demian
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
MrSameerSTathare
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
Sandro Mancuso
Cloud Computing & Cloud Storage
Cloud Computing & Cloud Storage
Priyesh Pratap Singh
Introduction to mongo db
Introduction to mongo db
Lawrence Mwai
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
Vlad Fedosov
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
manolitto
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JSFestUA
Airflow techtonic template
Airflow techtonic template
Sampath Kumar
Java and XPages
Java and XPages
Patrick Kwinten
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real Differences
All Things Open
Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014
Sandro Mancuso
Android training day 4
Android training day 4
Vivek Bhusal
Angular presentation
Angular presentation
Matus Szabo
How Databases Work - for Developers, Accidental DBAs and Managers
How Databases Work - for Developers, Accidental DBAs and Managers
EDB
Similaire à MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
(20)
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
Data Analytics with DBMS
Data Analytics with DBMS
Master Data Services - used for than just data
Master Data Services - used for than just data
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
XML Data Control - Oracle OpenWorld Preview AMIS - Richard Olrichs en Wilfred...
Fundaments of Knockout js
Fundaments of Knockout js
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
Cloudsim_openstack_aws_lastunit_bsccs_cloud computing
Crafted Design - ITAKE 2014
Crafted Design - ITAKE 2014
Cloud Computing & Cloud Storage
Cloud Computing & Cloud Storage
Introduction to mongo db
Introduction to mongo db
JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
Airflow techtonic template
Airflow techtonic template
Java and XPages
Java and XPages
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real Differences
Crafted Design - GeeCON 2014
Crafted Design - GeeCON 2014
Android training day 4
Android training day 4
Angular presentation
Angular presentation
How Databases Work - for Developers, Accidental DBAs and Managers
How Databases Work - for Developers, Accidental DBAs and Managers
Dernier
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
UiPathCommunity
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
Hervé Boutemy
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
null - The Open Security Community
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
2toLead Limited
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
Ridwan Fadjar
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Sergiu Bodiu
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Padma Pradeep
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
RankYa
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Fwdays
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
hariprasad279825
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Florian Wilhelm
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Enterprise Knowledge
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Zilliz
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Wonjun Hwang
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
Lorenzo Miniero
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Memoori
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
Dernier
(20)
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
MVC and IBM XPages - from #DanNotes in Korsør (DK) 28 November 2013
1.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S MVC i XPages Model – View – Controller M C V A presentation for DanNotes by John Dalsgaard
2.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Me ● ● ● ● ● Worked with Notes since 1995 version 4.5 Java since Notes5.0.7 (!!!) Large web-apps. (40.000+ users) Object Oriented approach since 1999 (yes, in LotusScript...) Now: XPages & mobile apps....
3.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Agenda ● ● Demo: What is this all about? What is MVC ● ● ● ● ● ● Data model: Data bean & DAO Service layer: CRUD/Facade View layer: View bean Why would you want to use MVC What to do in Domino ● Data structure ● Challenges... A word about the Demo app.
4.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Demo ● ● ● ● ● Simple example Isolate data access (DAO + interface) Validation in model (service layer) Binding to Java beans through Expression Language Separate Model from View → Easy to add new ”view” component – – XPage JSON WebService
5.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Demo – Data model Person Key Name Address Zip City Email YearBorn 1 n Car Key PersonKey Brand Model Colour Convertible Doors
6.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013
7.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Agenda ● ● Demo: What is this all about? What is MVC ● ● ● ● ● ● Data model: Data bean & DAO Service layer: CRUD/Facade View layer: View bean Why would you want to use MVC What to do in Domino ● Data structure ● Challenges... A word about the Demo app.
8.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S What is MVC ● A ”design pattern” – ● Very good practice for the task at hand Separation of the tasks: – – – Model: Business rules, data model and data manipulation Viewer: Presentation of data Controller: Flow in application
9.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S MVC - Model ● Java objects that implement: – Data model ● ● Contain data Manipulate data from the database – – – Specific database implementation CRUD (Create, Read, Update, Delete) Service layer ● Implement business rules – – Validation Combine data (e.g. number of years employed based on hire date)
10.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S The MODEL <<PersonDAO>> Service layer PersonCRUDFacade implements uses Data model DominoPersonDAO encapsulates Domino DB creates & uses for DB operations obtains updates Person
11.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Data model ● ● Is the only layer that knows the physical details of data access (documents, views, etc.) Consists of: – Data bean ● – all fields – with getter/setters – no logic DAO (Data Access Objects) ● Interface used by service layer – ● Defines all methods/operations Implementation of interface – – All handling of underlying database (e.g. recycle...) Implements necessary base functions for CRUD
12.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Service layer ● This is where the business logic of the application lives – – – – ● Workflows Validations Searches Etc. Connects to the DAO implementation through its interface – Not relying on the implementation and the underlying database ”dialect” (e.g. Domino)
13.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Service layer ● Do not duplicate Domino ”techniques” from the old days – – Eg. Invoice with invoice lines We have seen the pattern: line_1, line_2, line_3 in traditional Notes applicatctions ● – Create two data objects and (DAO's etc.) ● ● – Fixed number of ”relations” Invoice InvoiceLine Hide implementation details from the service layer
14.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S MVC - View ● Java objects for presentation that – – – – Are used by the XPage Often one-to-one between XPages and view Beans XPage talk to the view Bean – and never to the underlying database (it doesn't know it exists!) Typically defined to the XPages via facesconfig.xml
15.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S The VIEW XPage XPage references references PersonViewBean PersonEditBean uses uses Model <<PersonDAO>> PersonCRUDFacade implements uses DominoPersonDAO encapsulates Domino DB obtains updates creates & uses for DB operations Person
16.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S View Layer ● View Bean – – Implements all the methods that the ”client” sees Talks to the service layer ● – E.g. through a saveUser() method that does validation and throws a validation error to the bean if data is not valid Handles UI ”things”, e.g. showing validation errors reported by the service layer ● E.g. by connecting the validation errors from the service layer to the corresponding components on the XPage
17.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S View Layer ● XPage – Access the View Bean through the scopes ● ● – Define the bean in faces-config.xml … or create instance on load of page Access properties and methods through ● ● ● EL: e.g. UserBean.user.name SSJS: e.g. UserBean.user.getName() Call a ”save” method on submit, e.g. a button with SSJS: UserBean.user.saveUser()
18.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC - Controller ● This is the FacesServlet in XPages – – You do NOT code the controller...!!! It handles: ● ● ● ● Flow of incoming requests Data streams Interacts with the view layer for us If you do want to change behaviour in the controller? – – You need to understand the JSF LifeCycle Use a PhaseListener
19.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S The CONTROLLER FacesServlet renders receives creates modifies caches View XPage references PersonViewBean uses Model <<PersonDAO>> PersonCRUDFacade DominoPersonDAO Domin o DB Person
20.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Agenda ● ● Demo: What is this all about? What is MVC ● ● ● ● ● ● Data model: Data bean & DAO Service layer: CRUD/Facade View layer: View bean Why would you want to use MVC What to do in Domino ● Data structure ● Challenges... A word about the Demo app.
21.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 Why use MVC? ● ● Avoid data-duplication (in responses)...!!! Avoid successive lookups – ● Enable several ”clients” using same model, e.g. – – – ● Use Java objects in memory Browsers (XPages) Mobile browsers (jQuery Mobile) Mobile apps (JSON webservices) Independent of database architecture – – Possible to change to another DBMS Enable isolated optimizations (e.g. change to use org.openntf.domino API)
22.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 Why use MVC? ● Unit test... – The structure allows us to test our code at all ”Model” levels: ● ● ● – Data bean DAO implementation CRUD/Facade bean This allows easy re-test of all code after we have modified it → BETTER code...!!!!
23.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Agenda ● ● Demo: What is this all about? What is MVC ● ● ● ● ● ● Data model: Data bean & DAO Service layer: CRUD/Facade View layer: View bean Why would you want to use MVC What to do in Domino ● Data structure ● Challenges... A word about the Demo app.
24.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC in Domino ● First important fact: – An NSF is NOT a relational database ● ● ● However, we can emulate that in the service layer and treat it as such In the DAO we can use some of the characteristics of the NSF (e.g. response documents) – especially in relation to existing applications You should create Java objects to emulate the parent/child relations no matter what the underlying ”technique” is. Let the DAO handle the implementation...
25.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC in Domino ● Data duplication (from parent to child doc.) can be avoided...!! – ● ...by using your parent/child structure in the Java objects You will (most likely) not use any datasources in your XPages – but refer to beans instead
26.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC in Domino ● Validation and error messages – Choose to disable client side validation ● – Let the service layer bean validate data on submission ● ● – Will show error messages next to the fields Capture all error messages with a field reference (e.g. in a HashMap) Throw a validation error if not valid If view bean gets a validation error on save... ● ● Read all errors (through a getter) Iterate and ”bind” errors to all fields (through a FacesMessage)
27.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC in Domino ● Security – Readers/authors fields ● ● Very strong feature (compared to RDBMS's) Should reflect and enforce chosen security model – not be used for data retrieval etc. – due to performance impact – – But this is not really different from what you should have been doing always... These mechanisms should be implemented in the DAO ● Also includes other system fields like $PublicAccess etc.
28.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 MVC in Domino ● Beware: – – – Using Scoped beans you may need to ”Clean” your project for changes to be effective.... Use ”LogReader” (by Majkilde – download from openntf.org) to see messages in error-log0.xml (!!) Sometimes ”System.out.println” can be your friend in locating errors... ;-)
29.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Agenda ● ● Demo: What is this all about? What is MVC ● ● ● ● ● ● Data model: Data bean & DAO Service layer: CRUD/Facade View layer: View bean Why would you want to use MVC What to do in Domino ● Data structure ● Challenges... A word about the Demo app.
30.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 Demo database ● Demo database available: – ● Bitbucket: https://bitbucket.org/john_dalsgaard/demo-apps.git To set up: – – – Clone this project to your local source control Open the cloned project as a new Java Project in Domino Designer From the Package Explorer view ● – Select Team Development and then Associate with a new NSF... Create the database on a server (9.0+) and you are ready to explore the database
31.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 Demo database - EXTRAS ● Caching.... – In the service layer we have implemented caching of ALL dataobjects in memory ● ● ● Neat way of entering several rows – ● Runs FAST Need to remember to update memory object when updating the DB – but it is not difficult! … and handling cursor position (!!) Debug info written to console in lots of places – Phase listener shows in what phase these messages are generated
32.
© 2013, Dalsgaard
Data A/S Korsør, 28 November 2013 Demo database - EXTRAS ● Uses org.openntf.domino API – You need to install the org.openntf.domino.jar in your jvm/lib/ext directory. ● ● Download from openntf.org Validation: – Implemented in the service layer. Note method to place errors against right fields using FacesMessage
33.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Questions? ? ● …. or contact one of ”Gang of Four”: – – – – Jakob Majkilde: majkilde.dk Per Henrik Lausten: phl-consult.dk John Dalsgaard: www.dalsgaard-data.dk John Foldager: izone.dk
34.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Contact You are always welcome to contact me: John Dalsgaard Dalsgaard Data A/S Solbjergvej 42 Solbjerg DK-4270 Høng Phone: +45 4914-1271 Email: john@dalsgaard-data.dk www.dalsgaard-data.eu
35.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Sources ● Great articles from Pipalia: – Using JSF Framework Development Standards for your XPages Project ● ● ● ● ● ● Article 1 - The concept and motivation... Article 2 - Designing for MVC Article 3 - The DAO Article 4 - The CRUD (Facade) Article 5 - The Bean... Demo database
36.
Korsør, 28 November
2013 © 2013, Dalsgaard Data A/S Sources ● Validators.... – – – ● Pipalia: Using beans as validators Stack overflow: Answer by Sven Hasselbach Stack overflow: getComponent() XPages & DB2 – Example of alternate DAO using DB2
Télécharger maintenant