SlideShare a Scribd company logo
CMP-3110 ~ E-Commerce Applications Development
Lecture 02
Planning Our Framework
Framework
• Definition
• a basic structure underlying a system, concept, or text.
• In general, a framework is a real or conceptual structure intended to serve as
a support or guide for the building of something that expands the structure
into something useful.
Patterns
• Definition
• a design pattern is a general repeatable solution to a commonly occurring
problem in software design.
• A design pattern isn't a finished design that can be transformed directly into
code
• Uses of Design Patterns
• speed up the development process
• providing tested, proven development paradigms
Patterns
Which patterns will be used?
• Model-View-Controller (MVC)
• Registry
• Singleton
Model-View-Controller (MVC)
• Model
• Represents an object. It can also have logic to update controller if its data
changes.
• View
• Represents the visualization of the data that model contains.
• Controller
• Acts on both model and view. It controls the data flow into model object and
updates the view whenever data changes. It keeps view and model separate.
Model-View-Controller (MVC)
Model-View-Controller (MVC)
Model-View-Controller (MVC)
Reference: Software Engineering by Ian Summerville – 9th edition
Registry
• Provides a means to store a collection of objects within our
framework (Container of objects for reuse).
• Each set of controllers and models we create need to perform some
shared tasks, including:
• Querying the database
• Checking if the user is logged in, and if so, getting certain user data
• Sending data to the views to be generated (template management)
• Sending e-mails, for instance to confirm a purchase with the customer
• Interacting with the server's filesystem, for instance to upload photographs of
products
Registry
Singleton
• Restrict an object to one instance only
• However, we will use it to ensure we have only one instance of our
registry available in the framework at any point of time.
File/Folder Structure
Building a Framework
Pattern Implementation: MVC
Pattern Implementation: Registry
• Needs
• It needs to have a method to create certain objects and store them with a key.
• It needs another method, which when passed with a key as a parameter,
returns the object in question.
• working
• Processing the incoming URL, so our “index.php” file can route the request
correctly
• Building URLs based on a series of parameters, a query string, and the
URLdisplay/generation method we use
• Pagination
Pattern Implementation: Registry
• The code in the book makes up the basics of our registry, with two
arrays:
• One for objects
• One for settings
Pattern Implementation: Singleton
• The singleton pattern is very easy to implement, as it requires only a
few minor changes to a standard PHP class, to ensure that it is only
ever instantiated once.
• Needs
• A private constructor is used to prevent the direct creation of objects from
the class.
• The expensive process is performed within the private constructor.
• The only way to create an instance from the class is by using a static method
that creates the object only if it wasn't already created.
Routing requests

More Related Content

PDF
Asp 1-mvc introduction
PDF
Asp 1a-aspnetmvc
PDF
Aspnetmvc 1
PPTX
Getting started with MVC 5 and Visual Studio 2013
PPTX
MVC + ORM (with project implementation)
PPTX
Spring Web Presentation 123143242341234234
PPTX
MVC architecture by Mohd.Awais on 18th Aug, 2017
PPTX
Architectural Design & Patterns
Asp 1-mvc introduction
Asp 1a-aspnetmvc
Aspnetmvc 1
Getting started with MVC 5 and Visual Studio 2013
MVC + ORM (with project implementation)
Spring Web Presentation 123143242341234234
MVC architecture by Mohd.Awais on 18th Aug, 2017
Architectural Design & Patterns

Similar to E-Commerce Applications Development (20)

PPTX
MVC Framework
PPTX
ASP.NET Core Demos Part 2
PPTX
PPT
Ember.js: Jump Start
PPTX
Show Some Spine!
PPTX
PPTX
An Introduction To Model  View  Controller In XPages
PPTX
Laravel session 1
PPT
Web engineering - MVC
PPTX
Module2
PPT
Code igniter overview
PPTX
Mobile App Architectures & Coding guidelines
PPTX
MWLUG 2015 - An Introduction to MVC
PPTX
Using MVC with Kentico 8
PPTX
BackboneJS
PDF
WebDev Crash Course
PDF
Mastering asp.net mvc - Dot Net Tricks
PPTX
Sitecore mvc
PPTX
AngularJS
PPTX
Knockout implementing mvvm in java script with knockout
MVC Framework
ASP.NET Core Demos Part 2
Ember.js: Jump Start
Show Some Spine!
An Introduction To Model  View  Controller In XPages
Laravel session 1
Web engineering - MVC
Module2
Code igniter overview
Mobile App Architectures & Coding guidelines
MWLUG 2015 - An Introduction to MVC
Using MVC with Kentico 8
BackboneJS
WebDev Crash Course
Mastering asp.net mvc - Dot Net Tricks
Sitecore mvc
AngularJS
Knockout implementing mvvm in java script with knockout
Ad

More from Muhammad Sajid (20)

PPTX
eCommerce App Lecture
PPTX
Characteristics of enterprise application software
PPTX
The Checkout and Order Process
PPTX
The Shopping Basket
PPTX
Enhancing the User Experience
PPTX
Products and Categories
PPTX
E-Commerce Applications Development
PPTX
Data Transfer between Activities & Databases
PPTX
Data Transfer between Activities & Databases
PPTX
Data Transfer between Activities & Databases
PDF
Mobile Application Development
PDF
MOBILE APPLICATION DEVELOPMENT
PDF
MOBILE APPLICATION DEVELOPMENT
PDF
MOBILE APPLICATION DEVELOPMENT
PDF
MOBILE APPLICATION DEVELOPMENT
PPTX
Your first Android App
PPTX
Group Aided Decision making revised
PDF
Pakistan Studies notes
PDF
Components of Computing Game
PDF
Design Elements of Computing Game
eCommerce App Lecture
Characteristics of enterprise application software
The Checkout and Order Process
The Shopping Basket
Enhancing the User Experience
Products and Categories
E-Commerce Applications Development
Data Transfer between Activities & Databases
Data Transfer between Activities & Databases
Data Transfer between Activities & Databases
Mobile Application Development
MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENT
Your first Android App
Group Aided Decision making revised
Pakistan Studies notes
Components of Computing Game
Design Elements of Computing Game
Ad

Recently uploaded (20)

PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
HVAC Specification 2024 according to central public works department
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Trump Administration's workforce development strategy
PPTX
Introduction to Building Materials
PPTX
Computer Architecture Input Output Memory.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
20th Century Theater, Methods, History.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
Introduction to pro and eukaryotes and differences.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
HVAC Specification 2024 according to central public works department
FORM 1 BIOLOGY MIND MAPS and their schemes
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Trump Administration's workforce development strategy
Introduction to Building Materials
Computer Architecture Input Output Memory.pptx
History, Philosophy and sociology of education (1).pptx
B.Sc. DS Unit 2 Software Engineering.pptx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
202450812 BayCHI UCSC-SV 20250812 v17.pptx
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
Paper A Mock Exam 9_ Attempt review.pdf.
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
20th Century Theater, Methods, History.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Introduction to pro and eukaryotes and differences.pptx

E-Commerce Applications Development

  • 1. CMP-3110 ~ E-Commerce Applications Development Lecture 02 Planning Our Framework
  • 2. Framework • Definition • a basic structure underlying a system, concept, or text. • In general, a framework is a real or conceptual structure intended to serve as a support or guide for the building of something that expands the structure into something useful.
  • 3. Patterns • Definition • a design pattern is a general repeatable solution to a commonly occurring problem in software design. • A design pattern isn't a finished design that can be transformed directly into code • Uses of Design Patterns • speed up the development process • providing tested, proven development paradigms
  • 4. Patterns Which patterns will be used? • Model-View-Controller (MVC) • Registry • Singleton
  • 5. Model-View-Controller (MVC) • Model • Represents an object. It can also have logic to update controller if its data changes. • View • Represents the visualization of the data that model contains. • Controller • Acts on both model and view. It controls the data flow into model object and updates the view whenever data changes. It keeps view and model separate.
  • 8. Model-View-Controller (MVC) Reference: Software Engineering by Ian Summerville – 9th edition
  • 9. Registry • Provides a means to store a collection of objects within our framework (Container of objects for reuse). • Each set of controllers and models we create need to perform some shared tasks, including: • Querying the database • Checking if the user is logged in, and if so, getting certain user data • Sending data to the views to be generated (template management) • Sending e-mails, for instance to confirm a purchase with the customer • Interacting with the server's filesystem, for instance to upload photographs of products
  • 11. Singleton • Restrict an object to one instance only • However, we will use it to ensure we have only one instance of our registry available in the framework at any point of time.
  • 15. Pattern Implementation: Registry • Needs • It needs to have a method to create certain objects and store them with a key. • It needs another method, which when passed with a key as a parameter, returns the object in question. • working • Processing the incoming URL, so our “index.php” file can route the request correctly • Building URLs based on a series of parameters, a query string, and the URLdisplay/generation method we use • Pagination
  • 16. Pattern Implementation: Registry • The code in the book makes up the basics of our registry, with two arrays: • One for objects • One for settings
  • 17. Pattern Implementation: Singleton • The singleton pattern is very easy to implement, as it requires only a few minor changes to a standard PHP class, to ensure that it is only ever instantiated once. • Needs • A private constructor is used to prevent the direct creation of objects from the class. • The expensive process is performed within the private constructor. • The only way to create an instance from the class is by using a static method that creates the object only if it wasn't already created.