SlideShare a Scribd company logo
1 of 94
Download to read offline
An Introduction to the Model-View-Controller Pattern
Tweet about this event
And mention us: @Teamstudio @TLCCLTD
@Eknori and @pjanzen20
September 16, 2015
@Teamstudio
teamstudio.com
@TLCCLTD
tlcc.com
Courtney Carter
Marketing Associate
Teamstudio
Who We Are
• Manage, modernize, and mobilize your business
applications with software and solutions from
Teamstudio.
o Easy-to-use tools for developers and administrators
o Modernization Services to help you mobilize your
applications
o Mobilization platform for those who want to mobilize using
their own internal resources
• 1600+ active customers, 53 countries
• Offices in US, UK, and Japan
Teamstudio Unplugged
• Your mobile Domino server:
take your IBM Notes apps with you!
• End-users access Notes applications from mobile
devices whether online or offline
• Leverages the powerful technology of XPages
Unplugged Templates
• Continuity
Mobile offline access to BCM programs
• OneView Approvals
Expense approvals; anywhere, anytime
• CustomerView
Lightweight CRM framework for field sales and
field service teams
• Contacts – customer information database
• Activities – customer activity log
• Media – mobile offline file storage and access
• Set of Controls for IBM Domino developers
working on XPages applications and on
application modernization projects
• Re-write of the Teamstudio Unplugged Controls
project, but adds full support for PC browser-
based user interfaces as well as mobile interfaces
• Enables XPages developers to create controls
that are responsive
• Learn more:
teamstudio.com/solutions/xfoundations/xcontrols
XControls
Teamstudio Services
• Professional services for modernization, Web
enablement, project management, development,
and administration
o Modernization Services
o Developer Assistance Program
o Application Upgrade Analysis
o Application Complexity Analysis
o Application Usage Auditing
• http://www.teamstudio.com/solutions/services/
• XControls Business Edition promotion:
o Be entered to win an Apple iPad mini when you sign up to demo XControls Business
Edition before Oct. 31, 2015.
• ICON UK: Sept. 21 and 22 in London
1
#XPages
Your Hosts Today:
Howard Greenberg
TLCC
@TLCCLtd
An Introduction to the Model
View Controller Architecture
Paul Della-Nebbia
TLCC
@PaulDN
How can TLCC Help YOU!
2
• Private classes at
your location or
virtual
•XPages Development
•Support Existing Apps
•Administration
• Let us help you
become an expert
XPages developer!
• Delivered via Notes
• XPages
• Development
• Admin
• User
Self-
Paced
Courses
Mentoring
Instructor-
Led
Classes
Application
Development
and
Consulting
Free
Demo
Courses!
3
• Save hundreds and even Thousands of Dollars
on the most popular courses and packages:
XPages Development
Notes and Domino Development
Domino Administration
• Now extended through October 2nd
http://www.tlcc.com/fallsale
Upcoming and Recorded Webinars
4
www.tlcc.com/xpages-webinar
View Previous Webinars
(use url above)
• Life in the Fast Lane (XPages Peformance tips)
– October 15
• Ask The XPages Experts
– November 17
IBM Champion Nominations are Open
• Nominations are open for the IBM Champion program
– Through October 31st
– Go here to complete the nomination form
• If you think someone has contributed to the ICS
community then nominate them!
– Speaks at conferences
– Helps out in forums and Stack Overflow, etc.
– Hosts videos, blogs, webinars
– More about the IBM Champion Program here
5
Asking Questions – Q and A at the end
6
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions pane!
We will answer your questions
verbally at the end of the
webinar
Your Presenters Today:
7
#XPages
Pete Janzen
IBM
@pjanzen20
Update on IBM’s Application Development
Plans for XPages, Domino and Notes
Ulrich Krause
@eknori
An Introduction to the Model View
Controller Architecture
©2015 IBM Corporation
IBM Domino Application
Development Update
September 16, 2015
Pete Janzen – Sr. Product Manager, IBM
8
©2015 IBM Corporation
Domino Comes to Bluemix!
Experimental services now available
Realize the next generation of LOB apps
• App.Next  New types of applications that use services
like Watson, mobile, social files and more....
• Leverage your investment in Notes & Domino apps
• Easier path to modernized applications
• Integrate your on-premises applications
9
©2015 IBM Corporation
What Makes up Domino on Bluemix Experimental
Bluemix Runtime - IBM XPages
• Domino XPages runtime for building web applications
Bluemix Service - IBM XPages NoSQL Database
• NoSQL database (NSF) service playground
Bluemix Boilerplate – IBM XPages Web Starter
• Starter kit combines XPages runtime with XPages
NoSQL Database and sample app to quickly get
up and running on Bluemix
Domino Designer extensions
• Extensions for building for and deploying to Bluemix
Domino Designer
Experimental Beta
2H 2015
eGA
Roadmap*
* Subject to change at IBM’s sole discretion
©2015 IBM Corporation
Getting Started
• Get a Bluemix account
• If you do not already have one, then you can start a free 30 trial today
• https://apps.admin.ibmcloud.com/manage/trial/bluemix.html
• Get IBM Domino Designer 9.0.1
• https://www.ibm.com/developerworks/downloads/ls/dominodesigner/?S_CMP=LS
DL
• Install the latest XPages Extension Library into Domino Designer
• http://extlib.openntf.org
• 901v00_14.20150831-1301
• Log in to Bluemix and start coding !
©2015 IBM Corporation
Enablement & Feedback
Enablement
• Articles and videos: https://developer.ibm.com/bluemix/tag/xpages/
• Webcast
• An introduction to creating Domino applications in the Bluemix environment
https://www.socialbizug.org/blogs/ac3c982e-c4bb-4553-ae9c-
6633f03e5ee8/entry/Webcast_Replay_An_introduction_to_creating_Domino_applications_in_the_Bluemix_environment?lang=en_us
Feedback
• Free forum support for XPages runtime, XPages NoSQL Database service and
XPages Web Starter boilerplate is provided
https://developer.ibm.com/answers/smart-spaces/12/bluemix.html
Tag questions with XPages-runtime and/or XPages-service
12
©2015 IBM Corporation
Two Apple Related Updates
Technote 1962311: Supportability Q&A about IBM Notes and OS X 10.11.x
• http://www-01.ibm.com/support/docview.wss?uid=swg21962311
• Currently released IBM Notes 9.0.1.x 32-bit versions do not support Apple's
OS X 10.11.x El Capitan
• IBM Notes 9.0.1 64-bit planned for Fall of 2015 is planned to support OS X 10.11
• IBM Client Application Access (ICAA) will be released at same time as Notes 9.0.1 64-bit and
it will also work with El Capitan
Technote 1966059: Apple's App Transport Security prevents apps from connecting to a
Domino server
• http://www-01.ibm.com/support/docview.wss?uid=swg21966059
• Apple's native apps are not impacted, and IBM's Verse Mobile apps are not impacted.
• 3rd party Apps compiled for iOS9 / OSX10.11 will be impacted unless they exclude enforcing
App Transport Security (like we do for Verse mobile)
• Domino implementing Elliptic Curve cipher support to address by end of month as an interim
fix for 901FP4
13
An Introduction To MVC In XPages
Ulrich Krause,TLCC Webinar,16-SEP-2015
About:Ulrich Krause
• Administrator /Developer since1993
• OpenNTF Contributor
– DomBackup,TriggerHappy, !!Help!!
• IBM Champion 2011 – 2015
– https://ibm.biz/NominateChamps
• Blog http://www.eknori.de
• Twitter @eknori
• Mail: ulrich.krause@eknori.de
What do we want to learn today?
• The Constant In Life And Software Development
• Change Management Process
• Software Maintenance
• Code Quality
• Design Patterns
• MVC Basic
• Sample
The only constant in life
The only constant in software development
Change Management Process
SoftwareQuality - Overview
SoftwareQuality– User Perspective
SoftwareQuality – Developer Perspective
SoftwareLife-Cycle Costs
SoftwareQuality / Maintenance
• Challenges with „historically grown“ applications
– Code can be anywhere in the application
• Forms,View Events, Buttons, Hotspots, Script Libraries …
– Use of different languages
• LotusScript,@Formula,Javascript, Java,LS2Java,LS2CAPI, Simple
Actions,HTML …
– Redundancies
– Different programming styles
• One possible solution is to separate the Frontend from
the Backend Code.
– NotesDocument
– NotesUIDocument
Writing Good Code
Code Quality
if (state.Code == 4)
DoSomething();
Code Quality
‘If we are at the final state,
‘call method DoSomething()"
if (state.Code == 4)
DoSomething();
Code Quality
if (state.IsFinal)
DoSomething();
Code Quality - Chaining
s$ =
session.getDatabase("server"
,"db.nsf").GetView("view").g
etAllDocumentsByKey("key",
true).getFirstDocument().Get
FirstItem("iName").Text
What can we do?
Say goodbye to
sequential
programming
What can we do?
More procedurale
programming
What can we do?
Even better:
Object Oriented
Programming
(OOP)
Design Patterns
What are Design Patterns?
• Patterns are formalized best practices that the
programmer can use to solve common problems
when designing an application or system.
• Object-oriented design patterns typically show
relationships and interactions between classes or
objects, without specifying the final application
classes or objects that are involved
• GoF Patterns are considered the foundation of all
design patterns.
Gang Of Four - GoF
The 23 GoF Design Patterns
Design Patterns - Types
• CreationalPatterns
These design patterns provide a way to create objects while hiding
the creation logic, rather than instantiating objects directly using
new operator. This gives program more flexibility in deciding which
objects need to be created for a given use case.
• Structural Patterns
These design patterns concern class and object composition.
Concept of inheritance is used to compose interfaces and define
ways to compose objects to obtain new functionalities.
• Behavioral Patterns
These design patterns are specifically concerned with
communication between objects.
Design Patterns are NOT
• … a finished design that can be transformed directly into
source or machine code
• … a codesnippet that can be copied into your code.
Brief History Of MVC
• MVC was one of the first works to describe and
implement software constructs in terms of their
responsibilities.
• Trygve Reenskaug introduced MVC in the 1970s
• In the 1980s, Jim Althoff and others implemented a
version of MVC .
• MVC was expressed as a general concept, in a 1988
article.
Father Of MVC
• TrygveMikkjel HeyerdahlReenskaug (born 1930) is a
Norwegian computer scientist and professor emeritus of
the University of Oslo.
• He formulated the model-view-controller (MVC) pattern
for Graphic User Interface (GUI) software design in 1979
while visiting the Xerox Palo Alto Research Center
(PARC).
http://en.wikipedia.org/wiki/Trygve_Reenskaug
An ExampleProject Case
• You created a superhero web application/website for a
comic shop owner with a small database table.
• It is a huge success and your client is extremely satisfied.
• They ask you to change the application, they want to use
a different database and, according to market demand,
they definitely need both iPhone and Android apps.
• Now repeat this five times.
• The client keeps on asking for modifications and
expansions.
• These can be UI related changes and even complete
backend architecture changes.
However if you used MVC from the start
• … you’d notice that some things would have been less
painful
• … you’d been happier
Benefits of MVC
• 90% of the code for the web application and the mobile
app will be the same, but instead of saving the user data
to a Shared Object or through a web service, you’d be
using a local DB for instance.
• Without MVC,chances are pretty high you’ll be making
modifications in a bunch of classes.
• The same applies to the UI for instance. Only the way it’s
presented to the user is different.
MVC Components
Understanding MVC
The Model represents your data
structure. Typically your model
class will contain functions to
retrieve, insert, and update
information in the datastore
Understanding MVC
The View is the information that
is being presented to the user. A
View will normally be a web
page, but can be any other type
of "page"
Understanding MVC
The Controller serves as an
intermediary between the Model,
the View and any other resources
needed to process HTTP requests and
generate a web page
An easy way to understandMVC
• The Modelis the data,
• The View is the window on the screen,
• And the Controlleris the glue between the two
MVC Interaction
MVC Interaction
Sees
Updates
Manipulates
Uses
DEMO 1 – Sample Application
Sample Application
Sample Application – Overview.xsp
Sample Application – hero.xsp
Sample Application Design
Controller - de.eknori.controller.AppController
Controller – How does it work?
faces-config.xml
View Component - Overview.xsp
View Component - Hero.xsp
Model - de.eknori.model.Overview
Model - de.eknori.model.Hero
Data Access Object ( DAO )
• A data access object (DAO) is an
object that provides an abstract
interface to some type of database
or other persistence mechanism.
• All read / write data operations
are delegated to DAO.
• No other part of the application
has direct access to the underlying
data store
Data Access Object ( DAO )
http://www.architexa.com/
Changes - What ManagementWants …
Changes - WhatYouThink …
Changes - WhatYou Need …
Interface - Definition
• An interface in the Java programming language is an
abstract typethat is used to specify an interface (in the
generic sense of the term) that classes must implement.
• Interfaces are declared using the interface keyword,and
may only contain method signatureand constant
declarations (variable declarations that are declared to
be both static and final).
Create Interface from Existing Class
Create Interface from Existing Class
Create Interface from Existing Class
Create Interface from Existing Class
Needed Changes
Designer „automagically“ does the neccessary changes
– DaoNsf
– Overview
New Class:DaoXml
New Class:DaoXml
XML - DataSource
And Finally …
• Depending on which datasource to use, change that one
line in your code.
DEMO 2 – Sample Application
Useful Links
• Architexa helps you to understand and to document
large/complex codebases.
• Design Patterns in Java Tutorial
• Gang Of Four
Q & A
Twitter @eknori
Mail ulrich.krause@eknori.de
Follow up to the question about beans and managed beans in my sample application.
The controller is designed to replace the hero.xsp and overview.xsp with HeroBean and
OverviewBean. The bean is then put into the viewScope and can be accessed by using the
name "page".
This makes it easy to add new objects. people.xsp would be replaced by PeopleBean and it
can be accessed by referencing to page.YourMethod().
Using managed beans instead would mean to give each object a separate name and have
an additional entry in the faces-config.xml.
It is your own decision, which you like more. There is no advantage or disadvantage in
doing it my way or using managed beans instead.
Questions????
14
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions panel!
Remember, we will answer your
questions verbally
#XPages
@eknori
@TLCCLtd
@Teamstudio
@PaulDNUpcoming Events:
 ICON UK, London, England – Sept. 21-22
 Connect, Orlando – Jan. 31 to Feb. 3
Question and Answer Time!
15
Teamstudio Questions?
contactus@teamstudio.com
978-712-0924
TLCC Questions?
howardg@tlcc.com paul@tlcc.com
888-241-8522 or 561-953-0095
Howard
Greenberg
Paul
Della-Nebbia
Courtney
CarterUlrich Krause
Keep in mind:
TLCC Fall Sale
IBM Champion Nominations are Open

More Related Content

What's hot

Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
Jennie Gajjar
 
Training on webwroks1
Training on webwroks1Training on webwroks1
Training on webwroks1
sumeettechno
 
Web changesandasp4 upload
Web changesandasp4 uploadWeb changesandasp4 upload
Web changesandasp4 upload
READIFY
 

What's hot (20)

Moving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NETMoving to Microsoft Visual Basic .NET
Moving to Microsoft Visual Basic .NET
 
Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01Mvc 130330091359-phpapp01
Mvc 130330091359-phpapp01
 
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014bccon-2014 key01 ibm_collaboration_solutions_connect_2014
bccon-2014 key01 ibm_collaboration_solutions_connect_2014
 
bccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&outbccon-2014 dev04 domino_apps_reaching_up&out
bccon-2014 dev04 domino_apps_reaching_up&out
 
1 app 2 developers 3 servers
1 app 2 developers 3 servers1 app 2 developers 3 servers
1 app 2 developers 3 servers
 
XPages is Workflow's new best friend
XPages is Workflow's new best friendXPages is Workflow's new best friend
XPages is Workflow's new best friend
 
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
IBM Connect 2017: Your Data In the Major Leagues: A Practical Guide to REST S...
 
Web application architecture
Web application architectureWeb application architecture
Web application architecture
 
Dreamweaver Application
Dreamweaver ApplicationDreamweaver Application
Dreamweaver Application
 
Flex introduction
Flex introductionFlex introduction
Flex introduction
 
AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )
 
APIs for mobile
APIs for mobileAPIs for mobile
APIs for mobile
 
Silverlight
SilverlightSilverlight
Silverlight
 
Industrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.netIndustrial training seminar ppt on asp.net
Industrial training seminar ppt on asp.net
 
Visual basics
Visual basicsVisual basics
Visual basics
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applications
 
Training on webwroks1
Training on webwroks1Training on webwroks1
Training on webwroks1
 
Real World Windows Phone Development
Real World Windows Phone DevelopmentReal World Windows Phone Development
Real World Windows Phone Development
 
Ios models
Ios modelsIos models
Ios models
 
Web changesandasp4 upload
Web changesandasp4 uploadWeb changesandasp4 upload
Web changesandasp4 upload
 

Viewers also liked (6)

Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
MVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,MobileMVC(Model View Controller),Web,Enterprise,Mobile
MVC(Model View Controller),Web,Enterprise,Mobile
 
MVC Architecture
MVC ArchitectureMVC Architecture
MVC Architecture
 
Why Use MVC?
Why Use MVC?Why Use MVC?
Why Use MVC?
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 

Similar to An Introduction to the Model-View-Controller Pattern

Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
Mehdi Loutfi
 
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
dominion
 
NELotus - OpenNTF.org & XPages Mobile Controls
NELotus - OpenNTF.org & XPages Mobile ControlsNELotus - OpenNTF.org & XPages Mobile Controls
NELotus - OpenNTF.org & XPages Mobile Controls
John Head
 

Similar to An Introduction to the Model-View-Controller Pattern (20)

AD101: IBM Domino Application Development Futures
AD101: IBM Domino Application Development FuturesAD101: IBM Domino Application Development Futures
AD101: IBM Domino Application Development Futures
 
Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?
 
IBM Mail Next and Notes/Domino Roadmap
IBM Mail Next and Notes/Domino RoadmapIBM Mail Next and Notes/Domino Roadmap
IBM Mail Next and Notes/Domino Roadmap
 
Everything XControls
Everything XControlsEverything XControls
Everything XControls
 
Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
Introducing ibm-lotus-notes-and-domino-85-slideshow-1231267606343259-1
 
IBM Domino 10: A new chapter begins
IBM Domino 10: A new chapter beginsIBM Domino 10: A new chapter begins
IBM Domino 10: A new chapter begins
 
Cincom Smalltalk Roadmap 2010
Cincom Smalltalk Roadmap 2010Cincom Smalltalk Roadmap 2010
Cincom Smalltalk Roadmap 2010
 
AD1542 Get Hands On With Bluemix
AD1542 Get Hands On With BluemixAD1542 Get Hands On With Bluemix
AD1542 Get Hands On With Bluemix
 
Cincom Smalltalk News
Cincom Smalltalk NewsCincom Smalltalk News
Cincom Smalltalk News
 
Lessons Learned from a major IBM Collaboration Solutions Deployment
Lessons Learned from a major IBM Collaboration Solutions DeploymentLessons Learned from a major IBM Collaboration Solutions Deployment
Lessons Learned from a major IBM Collaboration Solutions Deployment
 
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
 
DACHNUG50 Roadmap.pdf
DACHNUG50 Roadmap.pdfDACHNUG50 Roadmap.pdf
DACHNUG50 Roadmap.pdf
 
Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...Philipe Riand - Building Social Applications using the Social Business Toolki...
Philipe Riand - Building Social Applications using the Social Business Toolki...
 
NELotus - OpenNTF.org & XPages Mobile Controls
NELotus - OpenNTF.org & XPages Mobile ControlsNELotus - OpenNTF.org & XPages Mobile Controls
NELotus - OpenNTF.org & XPages Mobile Controls
 
AdminCamp 2018 - ApplicationInsights für Administratoren
AdminCamp 2018 - ApplicationInsights für AdministratorenAdminCamp 2018 - ApplicationInsights für Administratoren
AdminCamp 2018 - ApplicationInsights für Administratoren
 
Lowering Costs: Should We Consider Lotus On Linux?
Lowering Costs: Should We Consider Lotus On Linux?Lowering Costs: Should We Consider Lotus On Linux?
Lowering Costs: Should We Consider Lotus On Linux?
 
Highlights from MS build\\2016 Conference
Highlights from MS build\\2016 ConferenceHighlights from MS build\\2016 Conference
Highlights from MS build\\2016 Conference
 
XPages: You Know the 'How to'. Now Learn the 'Why and What'.
XPages: You Know the 'How to'. Now Learn the 'Why and What'.XPages: You Know the 'How to'. Now Learn the 'Why and What'.
XPages: You Know the 'How to'. Now Learn the 'Why and What'.
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
 

More from Teamstudio

More from Teamstudio (20)

Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Search Terms and Design Complexity: A Tutorial Before Modernizing or MigratingSearch Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
 
SmartNSF - 100% Smart - and in Color!
SmartNSF - 100% Smart - and in Color!SmartNSF - 100% Smart - and in Color!
SmartNSF - 100% Smart - and in Color!
 
Back from the Dead: When Bad Code Kills a Good Server
Back from the Dead: When Bad Code Kills a Good ServerBack from the Dead: When Bad Code Kills a Good Server
Back from the Dead: When Bad Code Kills a Good Server
 
Understand Usage with Detailed Access Information
Understand Usage with Detailed Access InformationUnderstand Usage with Detailed Access Information
Understand Usage with Detailed Access Information
 
Marty, You're Just Not Thinking Fourth Dimensionally
Marty, You're Just Not Thinking Fourth DimensionallyMarty, You're Just Not Thinking Fourth Dimensionally
Marty, You're Just Not Thinking Fourth Dimensionally
 
IBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino RoadmapIBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino Roadmap
 
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
 
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Optimus XPages Part 2: The Deep Dive
Optimus XPages Part 2: The Deep DiveOptimus XPages Part 2: The Deep Dive
Optimus XPages Part 2: The Deep Dive
 
Getting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino APIGetting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino API
 
Understand the True Business Usage of Notes Applications with Usage Auditor
Understand the True Business Usage of Notes Applications with Usage AuditorUnderstand the True Business Usage of Notes Applications with Usage Auditor
Understand the True Business Usage of Notes Applications with Usage Auditor
 
Building Responsive Applications Using XPages
Building Responsive Applications Using XPagesBuilding Responsive Applications Using XPages
Building Responsive Applications Using XPages
 
Using Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino AppsUsing Cool New Frameworks in (Mobile) Domino Apps
Using Cool New Frameworks in (Mobile) Domino Apps
 
Ask the XPages Experts
Ask the XPages ExpertsAsk the XPages Experts
Ask the XPages Experts
 
Move Your XPages Applications to the Fast Lane
Move Your XPages Applications to the Fast LaneMove Your XPages Applications to the Fast Lane
Move Your XPages Applications to the Fast Lane
 
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
 
Transformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPagesTransformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPages
 
A Notes Developer's Journey into Java
A Notes Developer's Journey into JavaA Notes Developer's Journey into Java
A Notes Developer's Journey into Java
 
Mobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an AppMobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an App
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
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
 

Recently uploaded (20)

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...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 

An Introduction to the Model-View-Controller Pattern

  • 1. An Introduction to the Model-View-Controller Pattern Tweet about this event And mention us: @Teamstudio @TLCCLTD @Eknori and @pjanzen20 September 16, 2015
  • 3. Who We Are • Manage, modernize, and mobilize your business applications with software and solutions from Teamstudio. o Easy-to-use tools for developers and administrators o Modernization Services to help you mobilize your applications o Mobilization platform for those who want to mobilize using their own internal resources • 1600+ active customers, 53 countries • Offices in US, UK, and Japan
  • 4. Teamstudio Unplugged • Your mobile Domino server: take your IBM Notes apps with you! • End-users access Notes applications from mobile devices whether online or offline • Leverages the powerful technology of XPages
  • 5. Unplugged Templates • Continuity Mobile offline access to BCM programs • OneView Approvals Expense approvals; anywhere, anytime • CustomerView Lightweight CRM framework for field sales and field service teams • Contacts – customer information database • Activities – customer activity log • Media – mobile offline file storage and access
  • 6. • Set of Controls for IBM Domino developers working on XPages applications and on application modernization projects • Re-write of the Teamstudio Unplugged Controls project, but adds full support for PC browser- based user interfaces as well as mobile interfaces • Enables XPages developers to create controls that are responsive • Learn more: teamstudio.com/solutions/xfoundations/xcontrols XControls
  • 7. Teamstudio Services • Professional services for modernization, Web enablement, project management, development, and administration o Modernization Services o Developer Assistance Program o Application Upgrade Analysis o Application Complexity Analysis o Application Usage Auditing • http://www.teamstudio.com/solutions/services/
  • 8. • XControls Business Edition promotion: o Be entered to win an Apple iPad mini when you sign up to demo XControls Business Edition before Oct. 31, 2015. • ICON UK: Sept. 21 and 22 in London
  • 9. 1 #XPages Your Hosts Today: Howard Greenberg TLCC @TLCCLtd An Introduction to the Model View Controller Architecture Paul Della-Nebbia TLCC @PaulDN
  • 10. How can TLCC Help YOU! 2 • Private classes at your location or virtual •XPages Development •Support Existing Apps •Administration • Let us help you become an expert XPages developer! • Delivered via Notes • XPages • Development • Admin • User Self- Paced Courses Mentoring Instructor- Led Classes Application Development and Consulting Free Demo Courses!
  • 11. 3 • Save hundreds and even Thousands of Dollars on the most popular courses and packages: XPages Development Notes and Domino Development Domino Administration • Now extended through October 2nd http://www.tlcc.com/fallsale
  • 12. Upcoming and Recorded Webinars 4 www.tlcc.com/xpages-webinar View Previous Webinars (use url above) • Life in the Fast Lane (XPages Peformance tips) – October 15 • Ask The XPages Experts – November 17
  • 13. IBM Champion Nominations are Open • Nominations are open for the IBM Champion program – Through October 31st – Go here to complete the nomination form • If you think someone has contributed to the ICS community then nominate them! – Speaks at conferences – Helps out in forums and Stack Overflow, etc. – Hosts videos, blogs, webinars – More about the IBM Champion Program here 5
  • 14. Asking Questions – Q and A at the end 6 Use the Orange Arrow button to expand the GoToWebinar panel Then ask your questions in the Questions pane! We will answer your questions verbally at the end of the webinar
  • 15. Your Presenters Today: 7 #XPages Pete Janzen IBM @pjanzen20 Update on IBM’s Application Development Plans for XPages, Domino and Notes Ulrich Krause @eknori An Introduction to the Model View Controller Architecture
  • 16. ©2015 IBM Corporation IBM Domino Application Development Update September 16, 2015 Pete Janzen – Sr. Product Manager, IBM 8
  • 17. ©2015 IBM Corporation Domino Comes to Bluemix! Experimental services now available Realize the next generation of LOB apps • App.Next  New types of applications that use services like Watson, mobile, social files and more.... • Leverage your investment in Notes & Domino apps • Easier path to modernized applications • Integrate your on-premises applications 9
  • 18. ©2015 IBM Corporation What Makes up Domino on Bluemix Experimental Bluemix Runtime - IBM XPages • Domino XPages runtime for building web applications Bluemix Service - IBM XPages NoSQL Database • NoSQL database (NSF) service playground Bluemix Boilerplate – IBM XPages Web Starter • Starter kit combines XPages runtime with XPages NoSQL Database and sample app to quickly get up and running on Bluemix Domino Designer extensions • Extensions for building for and deploying to Bluemix Domino Designer Experimental Beta 2H 2015 eGA Roadmap* * Subject to change at IBM’s sole discretion
  • 19. ©2015 IBM Corporation Getting Started • Get a Bluemix account • If you do not already have one, then you can start a free 30 trial today • https://apps.admin.ibmcloud.com/manage/trial/bluemix.html • Get IBM Domino Designer 9.0.1 • https://www.ibm.com/developerworks/downloads/ls/dominodesigner/?S_CMP=LS DL • Install the latest XPages Extension Library into Domino Designer • http://extlib.openntf.org • 901v00_14.20150831-1301 • Log in to Bluemix and start coding !
  • 20. ©2015 IBM Corporation Enablement & Feedback Enablement • Articles and videos: https://developer.ibm.com/bluemix/tag/xpages/ • Webcast • An introduction to creating Domino applications in the Bluemix environment https://www.socialbizug.org/blogs/ac3c982e-c4bb-4553-ae9c- 6633f03e5ee8/entry/Webcast_Replay_An_introduction_to_creating_Domino_applications_in_the_Bluemix_environment?lang=en_us Feedback • Free forum support for XPages runtime, XPages NoSQL Database service and XPages Web Starter boilerplate is provided https://developer.ibm.com/answers/smart-spaces/12/bluemix.html Tag questions with XPages-runtime and/or XPages-service 12
  • 21. ©2015 IBM Corporation Two Apple Related Updates Technote 1962311: Supportability Q&A about IBM Notes and OS X 10.11.x • http://www-01.ibm.com/support/docview.wss?uid=swg21962311 • Currently released IBM Notes 9.0.1.x 32-bit versions do not support Apple's OS X 10.11.x El Capitan • IBM Notes 9.0.1 64-bit planned for Fall of 2015 is planned to support OS X 10.11 • IBM Client Application Access (ICAA) will be released at same time as Notes 9.0.1 64-bit and it will also work with El Capitan Technote 1966059: Apple's App Transport Security prevents apps from connecting to a Domino server • http://www-01.ibm.com/support/docview.wss?uid=swg21966059 • Apple's native apps are not impacted, and IBM's Verse Mobile apps are not impacted. • 3rd party Apps compiled for iOS9 / OSX10.11 will be impacted unless they exclude enforcing App Transport Security (like we do for Verse mobile) • Domino implementing Elliptic Curve cipher support to address by end of month as an interim fix for 901FP4 13
  • 22. An Introduction To MVC In XPages Ulrich Krause,TLCC Webinar,16-SEP-2015
  • 23. About:Ulrich Krause • Administrator /Developer since1993 • OpenNTF Contributor – DomBackup,TriggerHappy, !!Help!! • IBM Champion 2011 – 2015 – https://ibm.biz/NominateChamps • Blog http://www.eknori.de • Twitter @eknori • Mail: ulrich.krause@eknori.de
  • 24. What do we want to learn today? • The Constant In Life And Software Development • Change Management Process • Software Maintenance • Code Quality • Design Patterns • MVC Basic • Sample
  • 25. The only constant in life
  • 26. The only constant in software development
  • 32. SoftwareQuality / Maintenance • Challenges with „historically grown“ applications – Code can be anywhere in the application • Forms,View Events, Buttons, Hotspots, Script Libraries … – Use of different languages • LotusScript,@Formula,Javascript, Java,LS2Java,LS2CAPI, Simple Actions,HTML … – Redundancies – Different programming styles • One possible solution is to separate the Frontend from the Backend Code. – NotesDocument – NotesUIDocument
  • 34. Code Quality if (state.Code == 4) DoSomething();
  • 35. Code Quality ‘If we are at the final state, ‘call method DoSomething()" if (state.Code == 4) DoSomething();
  • 37. Code Quality - Chaining s$ = session.getDatabase("server" ,"db.nsf").GetView("view").g etAllDocumentsByKey("key", true).getFirstDocument().Get FirstItem("iName").Text
  • 38.
  • 39. What can we do? Say goodbye to sequential programming
  • 40. What can we do? More procedurale programming
  • 41. What can we do? Even better: Object Oriented Programming (OOP)
  • 43. What are Design Patterns? • Patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system. • Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved • GoF Patterns are considered the foundation of all design patterns.
  • 44. Gang Of Four - GoF
  • 45. The 23 GoF Design Patterns
  • 46. Design Patterns - Types • CreationalPatterns These design patterns provide a way to create objects while hiding the creation logic, rather than instantiating objects directly using new operator. This gives program more flexibility in deciding which objects need to be created for a given use case. • Structural Patterns These design patterns concern class and object composition. Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities. • Behavioral Patterns These design patterns are specifically concerned with communication between objects.
  • 47. Design Patterns are NOT • … a finished design that can be transformed directly into source or machine code • … a codesnippet that can be copied into your code.
  • 48. Brief History Of MVC • MVC was one of the first works to describe and implement software constructs in terms of their responsibilities. • Trygve Reenskaug introduced MVC in the 1970s • In the 1980s, Jim Althoff and others implemented a version of MVC . • MVC was expressed as a general concept, in a 1988 article.
  • 49. Father Of MVC • TrygveMikkjel HeyerdahlReenskaug (born 1930) is a Norwegian computer scientist and professor emeritus of the University of Oslo. • He formulated the model-view-controller (MVC) pattern for Graphic User Interface (GUI) software design in 1979 while visiting the Xerox Palo Alto Research Center (PARC). http://en.wikipedia.org/wiki/Trygve_Reenskaug
  • 50. An ExampleProject Case • You created a superhero web application/website for a comic shop owner with a small database table. • It is a huge success and your client is extremely satisfied. • They ask you to change the application, they want to use a different database and, according to market demand, they definitely need both iPhone and Android apps. • Now repeat this five times. • The client keeps on asking for modifications and expansions. • These can be UI related changes and even complete backend architecture changes.
  • 51. However if you used MVC from the start • … you’d notice that some things would have been less painful • … you’d been happier
  • 52. Benefits of MVC • 90% of the code for the web application and the mobile app will be the same, but instead of saving the user data to a Shared Object or through a web service, you’d be using a local DB for instance. • Without MVC,chances are pretty high you’ll be making modifications in a bunch of classes. • The same applies to the UI for instance. Only the way it’s presented to the user is different.
  • 54. Understanding MVC The Model represents your data structure. Typically your model class will contain functions to retrieve, insert, and update information in the datastore
  • 55. Understanding MVC The View is the information that is being presented to the user. A View will normally be a web page, but can be any other type of "page"
  • 56. Understanding MVC The Controller serves as an intermediary between the Model, the View and any other resources needed to process HTTP requests and generate a web page
  • 57. An easy way to understandMVC • The Modelis the data, • The View is the window on the screen, • And the Controlleris the glue between the two
  • 60. DEMO 1 – Sample Application
  • 62. Sample Application – Overview.xsp
  • 66. Controller – How does it work?
  • 68. View Component - Overview.xsp
  • 69. View Component - Hero.xsp
  • 72. Data Access Object ( DAO ) • A data access object (DAO) is an object that provides an abstract interface to some type of database or other persistence mechanism. • All read / write data operations are delegated to DAO. • No other part of the application has direct access to the underlying data store
  • 73. Data Access Object ( DAO ) http://www.architexa.com/
  • 74. Changes - What ManagementWants …
  • 76. Changes - WhatYou Need …
  • 77. Interface - Definition • An interface in the Java programming language is an abstract typethat is used to specify an interface (in the generic sense of the term) that classes must implement. • Interfaces are declared using the interface keyword,and may only contain method signatureand constant declarations (variable declarations that are declared to be both static and final).
  • 78. Create Interface from Existing Class
  • 79. Create Interface from Existing Class
  • 80. Create Interface from Existing Class
  • 81. Create Interface from Existing Class
  • 82. Needed Changes Designer „automagically“ does the neccessary changes – DaoNsf – Overview
  • 86. And Finally … • Depending on which datasource to use, change that one line in your code.
  • 87. DEMO 2 – Sample Application
  • 88. Useful Links • Architexa helps you to understand and to document large/complex codebases. • Design Patterns in Java Tutorial • Gang Of Four
  • 89. Q & A Twitter @eknori Mail ulrich.krause@eknori.de
  • 90.
  • 91.
  • 92. Follow up to the question about beans and managed beans in my sample application. The controller is designed to replace the hero.xsp and overview.xsp with HeroBean and OverviewBean. The bean is then put into the viewScope and can be accessed by using the name "page". This makes it easy to add new objects. people.xsp would be replaced by PeopleBean and it can be accessed by referencing to page.YourMethod(). Using managed beans instead would mean to give each object a separate name and have an additional entry in the faces-config.xml. It is your own decision, which you like more. There is no advantage or disadvantage in doing it my way or using managed beans instead.
  • 93. Questions???? 14 Use the Orange Arrow button to expand the GoToWebinar panel Then ask your questions in the Questions panel! Remember, we will answer your questions verbally
  • 94. #XPages @eknori @TLCCLtd @Teamstudio @PaulDNUpcoming Events:  ICON UK, London, England – Sept. 21-22  Connect, Orlando – Jan. 31 to Feb. 3 Question and Answer Time! 15 Teamstudio Questions? contactus@teamstudio.com 978-712-0924 TLCC Questions? howardg@tlcc.com paul@tlcc.com 888-241-8522 or 561-953-0095 Howard Greenberg Paul Della-Nebbia Courtney CarterUlrich Krause Keep in mind: TLCC Fall Sale IBM Champion Nominations are Open