SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Java and XPages
MVC
Software architectural pattern.
Divides an application into three interconnected parts.
Separates internal representations of information from the ways information is presented
to the user.
Model: 
These are your Java objects that contain and manipulate the data from the database and 
implement business rules for managing that data.
View: 
These are your presentation Java objects. Mostly a 1-to-1 relationship between an XPage 
(graphical view) and a related view Bean.
Controller: 
This middle layer is the JSF API. No code is written here by the developer of JSF applications 
(including XPages). This is the FacesServlet.
MVC Diagram
Components we will run into and their role in
MVC
FacesServlet
● Part of Controller in MVC
● Core of the JSF architecture, part of the web application server (Domino) API
– E.g. renders the XPage
– E.g. receives requests from a XPage
– E.g. creates & updates Managed Beans
● Already setup for us by IBM. We do not write code for FacesServlet :::
XPages
● Sounds familiar :::
● Part of View in MVC
– E.g. controls the look and feel of your web page
– E.g acts as the set of instructions for the FacesServlet to do its job.
● All of those tags/controls you place on the XPage have related Java code behind the
scenes.
– Simple as HTML rendering information
– Or complex processing instructions for datasets
– All executed by the FacesServlet
Managed Bean
● Part of View in MVC
● Simplified: a set of instructions for the FacesServlet to process
● XPages does nothing to or with a Managed Bean
● XPages stores only references to a Managed Bean
– Tells FacesServlet to place data in the HTML
– Tells to store data in the Managed Bean
● Acts as the client to the Façade
Example: EmployeeBean
● Primary goal to work only at the View layer
● Should not contain data processing business logic
– Delegate this to the Model layer
CRUD Facade
● Part of Model in MVC
● Enclose the business logic of retrieving data from the system
– Create Read Update Delete actions
● Provides a client interface to a logically grouped set of instructions executed on other
Java objects.
– Managed Bean is the client 
– Low level work and instructions are delegated to classes that make up the Data
Access Objects
● Example: EmployeeCRUDFacade
Data Access Object (DAO) – Interface
● Part of Model in MVC
● Sort of contract:
– Common methods that each DAO must implement
– From ”application point of view”, not from the system or database.
– The client (Facade) can always expect to run the same method, regardless
underlying database (Domino, Oracle, SQL)
● Example: EmployeeDOA
Data Access Object (DAO) - Database
● Describes how to access the data from ”database point of view”
● Domino:
– Database (NSF)
– Views
– Collections
– Notes document
– Fields etcetera
● Example: DominoEmployeeDOA
Data object class
● Part of Model in MVC
● Low(est) level description of data/object e.g. an employee
● Contains properties (~ fields) and methods (getter and setters for fields)
● Contains no real logic
Everything in a diagram
Java classes & conventions
● Objects represented by classes
● Resides in a package (~ folder):
– Toplevel domain.domain.application/project.folder.object
– E.g. se.acme.project.model.employee.class
●
● *1 Class names starts with capital e.g. Employee.class
● *2 Package resides in WebContent/WEB-INF/src folder
Documentation:
*1) http://www.oracle.com/technetwork/java/codeconventions-135099.html
*2) https://www-10.lotus.com/ldd/ddwiki.nsf/dx/Creating_a_Java_Control_in_an_NSF

Weitere ähnliche Inhalte

Was ist angesagt?

Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
Vikas Goyal
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
Holasz Kati
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent Projects
Mert Çalışkan
 

Was ist angesagt? (20)

CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPages
 
Project Presentation on Advance Java
Project Presentation on Advance JavaProject Presentation on Advance Java
Project Presentation on Advance Java
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
Maven
MavenMaven
Maven
 
Maven
Maven Maven
Maven
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
 
Play Framework workshop: full stack java web app
Play Framework workshop: full stack java web appPlay Framework workshop: full stack java web app
Play Framework workshop: full stack java web app
 
Maven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in MavenMaven plugins, properties en profiles: Advanced concepts in Maven
Maven plugins, properties en profiles: Advanced concepts in Maven
 
Maven tutorial for beginners
Maven tutorial for beginnersMaven tutorial for beginners
Maven tutorial for beginners
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages HeavenIBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
 
Jdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent ProjectsJdc 2010 - Maven, Intelligent Projects
Jdc 2010 - Maven, Intelligent Projects
 
Preparing your code for Java 9
Preparing your code for Java 9Preparing your code for Java 9
Preparing your code for Java 9
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
JavaFX Uni Parthenope
JavaFX Uni ParthenopeJavaFX Uni Parthenope
JavaFX Uni Parthenope
 

Ähnlich wie Java and XPages

ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
eldorina
 

Ähnlich wie Java and XPages (20)

Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1... Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
Web Component Development Using Servlet & JSP Technologies (EE6) - Chapter 1...
 
Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!Comparison of spring and other frameworks.!
Comparison of spring and other frameworks.!
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Struts & spring framework issues
Struts & spring framework issuesStruts & spring framework issues
Struts & spring framework issues
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Pattern oriented architecture for web based architecture
Pattern oriented architecture for web based architecturePattern oriented architecture for web based architecture
Pattern oriented architecture for web based architecture
 
MVC
MVCMVC
MVC
 
Introduction to ejb and struts framework
Introduction to ejb and struts frameworkIntroduction to ejb and struts framework
Introduction to ejb and struts framework
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
Month 2 report
Month 2 reportMonth 2 report
Month 2 report
 
MVC
MVCMVC
MVC
 
MVC in PHP
MVC in PHPMVC in PHP
MVC in PHP
 
JSF Presentation"2"
JSF Presentation"2"JSF Presentation"2"
JSF Presentation"2"
 
Mvc ppt
Mvc pptMvc ppt
Mvc ppt
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
Dssv1.0
Dssv1.0Dssv1.0
Dssv1.0
 
Jsp with mvc
Jsp with mvcJsp with mvc
Jsp with mvc
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Java and XPages

  • 2. MVC Software architectural pattern. Divides an application into three interconnected parts. Separates internal representations of information from the ways information is presented to the user. Model:  These are your Java objects that contain and manipulate the data from the database and  implement business rules for managing that data. View:  These are your presentation Java objects. Mostly a 1-to-1 relationship between an XPage  (graphical view) and a related view Bean. Controller:  This middle layer is the JSF API. No code is written here by the developer of JSF applications  (including XPages). This is the FacesServlet.
  • 4. Components we will run into and their role in MVC
  • 5. FacesServlet ● Part of Controller in MVC ● Core of the JSF architecture, part of the web application server (Domino) API – E.g. renders the XPage – E.g. receives requests from a XPage – E.g. creates & updates Managed Beans ● Already setup for us by IBM. We do not write code for FacesServlet :::
  • 6. XPages ● Sounds familiar ::: ● Part of View in MVC – E.g. controls the look and feel of your web page – E.g acts as the set of instructions for the FacesServlet to do its job. ● All of those tags/controls you place on the XPage have related Java code behind the scenes. – Simple as HTML rendering information – Or complex processing instructions for datasets – All executed by the FacesServlet
  • 7. Managed Bean ● Part of View in MVC ● Simplified: a set of instructions for the FacesServlet to process ● XPages does nothing to or with a Managed Bean ● XPages stores only references to a Managed Bean – Tells FacesServlet to place data in the HTML – Tells to store data in the Managed Bean ● Acts as the client to the Façade Example: EmployeeBean ● Primary goal to work only at the View layer ● Should not contain data processing business logic – Delegate this to the Model layer
  • 8. CRUD Facade ● Part of Model in MVC ● Enclose the business logic of retrieving data from the system – Create Read Update Delete actions ● Provides a client interface to a logically grouped set of instructions executed on other Java objects. – Managed Bean is the client  – Low level work and instructions are delegated to classes that make up the Data Access Objects ● Example: EmployeeCRUDFacade
  • 9. Data Access Object (DAO) – Interface ● Part of Model in MVC ● Sort of contract: – Common methods that each DAO must implement – From ”application point of view”, not from the system or database. – The client (Facade) can always expect to run the same method, regardless underlying database (Domino, Oracle, SQL) ● Example: EmployeeDOA
  • 10. Data Access Object (DAO) - Database ● Describes how to access the data from ”database point of view” ● Domino: – Database (NSF) – Views – Collections – Notes document – Fields etcetera ● Example: DominoEmployeeDOA
  • 11. Data object class ● Part of Model in MVC ● Low(est) level description of data/object e.g. an employee ● Contains properties (~ fields) and methods (getter and setters for fields) ● Contains no real logic
  • 12. Everything in a diagram
  • 13. Java classes & conventions ● Objects represented by classes ● Resides in a package (~ folder): – Toplevel domain.domain.application/project.folder.object – E.g. se.acme.project.model.employee.class ● ● *1 Class names starts with capital e.g. Employee.class ● *2 Package resides in WebContent/WEB-INF/src folder Documentation: *1) http://www.oracle.com/technetwork/java/codeconventions-135099.html *2) https://www-10.lotus.com/ldd/ddwiki.nsf/dx/Creating_a_Java_Control_in_an_NSF