Web Technology Solutions

Slides:



Advertisements
Similar presentations
By Waqas Over the many years the people have studied software-development approaches to figure out which approaches are quickest, cheapest, most.
Advertisements

Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
CLASS INHERITANCE Class inheritance is about inheriting/deriving properties from another class. When inheriting a class you are inheriting the attributes.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
CS-2135 Object Oriented Programming
Object-Oriented PHP (1)
1 Programming for Engineers in Python Autumn Lecture 5: Object Oriented Programming.
HST 952 Computing for Biomedical Scientists Lecture 2.
ASP.NET Programming with C# and SQL Server First Edition
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
Object-Oriented Programming with C++ Yingcai Xiao.
Object Orientation An Object oriented approach views systems and programs as a collection of interacting objects. An object is a thing in a computer system.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
Module 7: Object-Oriented Programming in Visual Basic .NET
OO (Object Oriented) Programming Chapter 21 IB103 Week 12.
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.
Object Oriented Programming in PHP. Topics Quick OOP Review Classes Magic Methods Static Methods Inheritance Exceptions Interfaces Operators Type Hinting.
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Object-Oriented PHP (Chapter 6).
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Question of the Day  On a game show you’re given the choice of three doors: Behind one door is a car; behind the others, goats. After you pick a door,
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Object Oriented Programming in PHP. List of Items of Interest What is a Class What is an Object What is a Singleton Multiple Objects, How to store. Advantages.
Date : 02/03/2014 Web Technology Solutions Class: OOP PHP, Design Patterns and CRUD.
Date : 2/12/2010 Web Technology Solutions Class: Adding Security and Authentication Features to Your Application.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
1 OOP - An Introduction ISQS 6337 John R. Durrett.
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Learning OOP in PHP. What is OOP? OOP stands for Object Oriented Programming. OOP is a programming paradigm wherein you create “objects” to work with.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
Industrial Group Project Introduction to Object Oriented Programming Adelina Basholli, February, 2016.
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Classes C++ representation of an object
JAVA By Waqas.
Object-Oriented Programming: Inheritance
Classes and OOP.
CS3340 – OOP and C++ L. Grewe.
OOP What is problem? Solution? OOP
PHP Classes and Objects
Object-Orientated Programming
Week 4 Object-Oriented Programming (1): Inheritance
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object Oriented Analysis and Design
Chapter 10 Thinking in Objects
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Object Oriented Analysis and Design
MSIS 670 Object-Oriented Software Engineering
Lecture 22 Inheritance Richard Gesick.
Object-Oriented Programming
Advanced Java Programming
Object Oriented Programming
Object-Oriented Programming
Object-Oriented Programming
Object-Oriented Programming
Object Oriented Analysis and Design
Review of Previous Lesson
Classes C++ representation of an object
CPS120: Introduction to Computer Science
Object-Oriented Programming
Object Oriented Design & Analysis
Mr. Justin “JET” Turner CSCI 3000 – Fall 2016 Section DA MW 4:05-5:20
Object Oriented Programming(OOP)
Presentation transcript:

Web Technology Solutions Class: OOP PHP, Design Patterns and CRUD Date : 02/09/2012

Tonight CRUD Redux Objects in PHP OOP Design Patterns Lab

Lab Preview Continue to build a simple CRUD app with the presidents table.

OOP in PHP Object Oriented Programming Objects and Classes PHP4 vs PHP5 Design Patterns Example

OOP in PHP Objects are discrete bundles of functions relating a concept (database connections, image creation, managing users) Objects work together to create applications. Service multiple projects with a single set of code. Code is portable, encapsulated, reusable and easier to debug.

OOP Example

OOP Car Functions of a car Accelerate, Stop, Steering How? (implementation) Gas Pedal, Engine Breaks Steering and Wheels Care how it works? No.

Object Oriented Programming What is an object: A “copy” or “instance” of a class. Objects have properties (color, speed, horsepower, seats) Objects have methods (accelerate, stop, steering).

Object Oriented Programming /* <?php * File Name: car * Date: November 18, 2010 * Author: Lincoln Mongillo * Description: Manages Car */ class Car { } ?>

Object Oriented Programming <?php $myRaceCar = new Car(); $myRaceCar -> accelerate(55); ?>

Object Oriented Programming Car = a basic blueprint that represents any car. color wheels seats horsepower With Car we can “create” other types of speciality cars: dump trucks, sports cars. How? Classes can “inherit” properties and methods from other classes.

Object Oriented Programming Car wheels: 4 color: white seats: 4 horsepower: 8 race car truck wheels: 4 color: white seats: 2 horsepower: 200 wheels: 4 color: red seats: 8 horsepower: 100 wheels: 4 color: white seats: 4 horsepower: 200 wheels: 4 color: white seats: 4 horsepower: 200

Object Oriented Inheritance /* <?php * File Name: RaceCar * Date: November 18, 2008 * Author: Lincoln Mongillo * Description: Manages RaceCars */ class RaceCar extends Car { } ?>

Object Oriented Polymorphism A Truck vs. Race Car come from car. Extending a class allows for “Polymorphism” which allows you to perform different tasks based on the context you’re using it in. Example: stop() between truck vs. racecar is somewhat the same but different because of the nature of the truck (size) and racecar (speed). It might implement the method differently to get the result.

Object Oriented Encapsulation Don’t need to know how it works (members functions or props) You just need to know what you can do (available methods - interface)

Object Oriented Encapsulation How do you know what you can use? Levels of visibility public: means that a class member is visible and usable / modifiable by everyone - default in PHP private: means that a class member is only usable / modifiable by the class itself protected: means that a class member is only usable / modifiable by the class itself and eventual sub-classes

Class Constructor - PHP4 class Car { public function Car() { echo "We just created and object!"; } ?>

Class Constructor - PHP5 class Car {     function __construct() {           echo "We just created and object!";       }   } ?>

Class Constructor - Properties class Car <?php { private $color;   private $wheels;   private $seats;       function __construct() {   $this->color = “OxFFFFF”; $this->wheels = 4;     }   } ?>

Class Constructor - Properties     function __construct() {   $this->color = “OxFFFFF”; $this->wheels = 4;   // $this is a reference to the object that is calling it. $truck = new Car(); // $this = truck.

Object Oriented Programming Image Example Database Example

Lab & Next Week Please send me your Survey in word doc format. Your personal DB will be updated next week and we will start working on the app.

Lab & Next Week Homework Complete Presidents CRUD system

Lab & Next Week Next week we will Create Registration system Create Login w\ Encrypt Password. Security and Authorization Reading: Chapter 4,7, and 14 See you Tuesday!