The only constant in software development is CHANGE. Every piece of software that has been developed and shipped to a customer will be changed numerous times during its lifecycle. A good design pattern can help make changes easy. MVC, an acronym for Model - View - Controller, is becoming THE recommended model for designing frameworks - especially on the Web. This webinar will give an overview of design patterns in general, and in particular, MVC.
Ulrich Krause shows how to use the MVC design paradigm in an XPages application and demonstrate how easy it is to implement changes. Need to read/write your data from/to an XML file instead of using a Notes View? MVC makes software maintenance as easy as 1-2-3!
BONUS! During this webinar, Pete Janzen, IBM Product Manager, provides a short update about what's new and upcoming from IBM for XPages and Domino application development.
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
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
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
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.
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
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
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).
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