РНР. Уровень 4. Проектирование и разработка сложных веб-проектов на РНР 5 Reflection.

Slides:



Advertisements
Similar presentations
M a r c – o l i v e r p a h l Informatik I – Kapitel 8 Höhere objektorientierte Konzepte Zusammenfassung des Kapitel 8 Küchlin, Weber, Einführung in die.
Advertisements

Introduction to Java Reflection
Continuation of chapter 6…. Nested while loop A while loop used within another while loop is called nested while loop. Q. An illustration to generate.
Architecture (simplified view) method object Reflection plane Object plane Class object Method object.
JSP and Servelets.
Lists: An internal look
The ArrayList Class and the enum Keyword
DATA STRUCTURES Lecture: Interfaces Slides adapted from Prof. Steven Roehrig.
Java Programming Abstract classes and Interfaces.
Inheritance // A simple class hierarchy. // A class for two-dimensional objects. class TwoDShape { double width; double height; void showDim() { System.out.println("Width.
Software Engineering Implementation Lecture 3 ASPI8-4 Anders P. Ravn, Feb 2004.
Public class ABC { private int information = 0; private char moreInformation = ‘ ‘; public ABC ( int newInfo, char moreNewInfo) { } public ABC () {} public.
INTERFACES IN JAVA 1.Java Does not support Multiple Inheritance directly. Multiple inheritance can be achieved in java by the use of interfaces. 2.We need.
Reflection Reflection is the ability of a program to examine and modify the structure and behavior of an object at runtime.
10/18/08 Matt Swatzell. What is Reflection?  Some Definitions….  Reflection is the process by which a program can modify its own behavior.  A program.
Lecture 28: Abstract Classes & Inheritance Announcements & Review Lab 8 Due Thursday Image and color effects with 2D arrays Read: –Chapter 9 Cahoon & Davidson.
1 More on Inheritance Overview l Object: The father of all classes l Casting and Classes l Object Cloning l Importance of Cloning.
Principles of Object-Oriented Software Development The language Java.
1 Java Reflection. 2 Java looking at Java l One of the unusual capabilities of Java is that a program can examine itself »You can determine the class.
INF 523Q Chapter 5: Enhancing Classes (Examples).
Creating Classes from Other Classes Chapter 2. 2 Chapter Contents Composition Adapters Inheritance Invoking constructors from within constructors Private.
1 Java object model Part 3: Serialization & Reflection.
13-Jul-15 Reflection. 2 Java looking at Java One of the unusual capabilities of Java is that a program can examine itself You can determine the class.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
CMSC 202 Interfaces. 11/20102 Classes and Methods When a class defines its methods as public, it describes how the class user interacts with the method.
SEG4110 – Advanced Software Design and Reengineering TOPIC H Java Reflection.
Java Reflection. Compile-Time vs Run-Time Some data you know at compile time: int area = radius*radius*3.14; The “3.14” is set – known at compile time.
Object Oriented Programming in Java Lecture 13. Java Reflection Reflection is a feature unique to Java that allows an executing program to examine or.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Introduction to Java Prepared by: Ahmed Hefny. Outline Classes Access Levels Member Initialization Inheritance and Polymorphism Interfaces Inner Classes.
РНР. Уровень 4. Проектирование и разработка сложных веб-проектов на РНР 5 PHP Data Objects.
Reflection in Java Bibliografie: Sun: The Java Tutorials – The Reflection API Java programming.
Reflection.NET Support for Reflection. What is Reflection Reflection: the process by which a program can observe and modify its own structure and behavior.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
Chapter 5 Objects and Classes Inheritance. Solution Assignments 3 & 4 Review in class…..
CMSC 341 Java Packages, Classes, Variables, Expressions, Flow Control, and Exceptions.
Chapter 3 Introduction to Classes and Objects Definitions Examples.
1 The finalize, clone, and getClass Methods  The finalize method is invoked by the garbage collector on an object when the object becomes garbage.  The.
U n i v e r s i t y o f H a i l 1 ICS 202  2011 spring  Data Structures and Algorithms 
Application development with Java Lecture 21. Inheritance Subclasses Overriding Object class.
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
(c) University of Washington06-1 CSC 143 Java Inheritance Tidbits.
РНР. Уровень 4. Проектирование и разработка сложных веб-проектов на РНР 5 Шаблон проектирования MVC.
Java Programming Persistent Data Types. Persistent Data Structure A persistent data structure is a data structure having an internal state that never.
CSE 331 Reflection slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia
03G-1 Reflection In Java “Reflection is the ability of a program to manipulate as data something representing the state of the program during its own execution.”
College Board Topics – A.P. Computer Science A Program Design - Read and understand a problem's description, purpose, and goals; Apply data abstraction.
Reference Types CSE301 University of Sunderland Harry R Erwin, PhD.
JAVA ACCESS MODIFIERS. Access Modifiers Access modifiers control which classes may use a feature. A classes features are: - The class itself - Its member.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 7 th Lecture Pavel Ježek
Chapter 7: Cloning and RTTI
NESTED CLASSES REFLECTION PROXIES.
Examples of Classes & Objects
using System; namespace Demo01 { class Program
Interface.
Ch 14: Search and Sorting Yonglei Tao.
CSE 413, Autumn 2002 Programming Languages
Advanced .NET Programming I 7th Lecture
null, true, and false are also reserved.
Introduction to Java Programming
Classes & Objects: Examples
Introduction to Programming
Chapter 11: More on the Implications of Inheritance
Announcements & Review
JavaScript Reserved Words
مظفر بگ محمدی دانشگاه ایلام
class PrintOnetoTen { public static void main(String args[]) {
CIS 199 Final Review.
Agenda Types and identifiers Practice Assignment Keywords in Java
Advanced .NET Programming I 8th Lecture
Presentation transcript:

РНР. Уровень 4. Проектирование и разработка сложных веб-проектов на РНР 5 Reflection

Темы модуля Reflection Лабораторная работа

Reflection  class Reflection  interface Reflector  class ReflectionFunction implements Reflector  class ReflectionParameter implements Reflector  class ReflectionMethod extends ReflectionFunction  class ReflectionClass implements Reflector  class ReflectionObject extends ReflectionClass  class ReflectionProperty implements Reflector  class ReflectionExtension implements Reflector

Class Reflection и Interface Reflector  Class Reflection Reflection { public static void export ( Reflector $reflector [, string $return = false ] ) public static array getModifierNames ( int $modifiers ) }  Interface Reflector Reflector { abstract public static string export ( void ) abstract public string __toString ( void ) }

ReflectionFunction  ReflectionFunction extends ReflectionFunctionAbstract implements Reflector  Свойства public $name ;  Методы __construct ( string $name ) public static string export ( string $name [, string $return ] ) public mixed invoke ([ string $args ] ) public string __toString ( void )

ReflectionFunction: наследованые методы final private void __clone ( void ) public string getDocComment ( void ) public string getFileName ( void ) public string getName ( void ) public int getNumberOfParameters ( void ) public int getNumberOfRequiredParameters ( void ) public array getParameters ( void ) public array getStaticVariables ( void ) public bool isInternal ( void ) public bool isUserDefined ( void ) public bool returnsReference ( void ) abstract public void __toString ( void )

ReflectionParameter  ReflectionParameter implements Reflector  Свойства public $name ;  Методы public bool allowsNull ( void ) public ReflectionFunction getDeclaringFunction ( void ) public mixed getDefaultValue ( void ) public string getName ( void ) public int getPosition ( void ) public bool isArray ( void ) public bool isDefaultValueAvailable ( void ) public bool isOptional ( void ) public bool isPassedByReference ( void ) public string __toString ( void )

ReflectionMethod  ReflectionMethod extends ReflectionFunctionAbstract implements Reflector  Константы const integer IS_STATIC = 1; const integer IS_PUBLIC = 256 ; const integer IS_PROTECTED = 512 ; const integer IS_PRIVATE = 1024 ; const integer IS_ABSTRACT = 2 ; const integer IS_FINAL = 4 ;  Свойства public $name; public $class;

ReflectionMethod: методы public ReflectionClass getDeclaringClass ( void ) public int getModifiers ( void ) public mixed invoke ( object $object, string $args ) public bool isAbstract ( void ) public bool isConstructor ( void ) public bool isDestructor ( void ) public bool isFinal ( void ) public bool isPrivate ( void ) public bool isProtected ( void ) public bool isPublic ( void ) public bool isStatic ( void )

ReflectionClass  ReflectionClass implements Reflector  Константы const integer IS_FINAL = 64;  Свойства public $name;  Методы final private void __clone ( void ) __construct ( string $argument ) public static string export ( mixed $argument [, bool $return = false ] ) public mixed getConstant ( string $name ) public array getConstants ( void )

ReflectionClass: методы public ReflectionExtension getExtension ( void ) public string getExtensionName ( void ) public array getInterfaces ( void ) public array getMethods ([ string $filter ] ) public int getModifiers ( void ) public string getName ( void ) public object getParentClass ( void ) public array getProperties ([ int $filter ] ) public array getStaticProperties ( void ) public mixed getStaticPropertyValue ( string $name [, string $default ] ) public bool hasConstant ( string $name ) public bool hasMethod ( string $name ) public bool hasProperty ( string $name ) public bool implementsInterface ( string $interface ) public bool isAbstract ( void ) public bool isFinal ( void )

ReflectionObject  ReflectionObject extends ReflectionClass implements Reflector  Константы const integer IS_FINAL = 64;  Свойства  Методы __construct ( object $argument ) public static string export ( string $argument [, bool $return ] )  Наследованые методы

ReflectionProperty  ReflectionProperty implements Reflector  Константы const integer IS_STATIC = 1; const integer IS_PUBLIC = 256; const integer IS_PROTECTED = 512; const integer IS_PRIVATE = 1024;  Свойства public $name; public $class;

ReflectionProperty: методы final private void __clone ( void ) __construct ( mixed $class, string $name ) public static string export ( mixed $class, string $name [, bool $return ] ) public ReflectionClass getDeclaringClass ( void ) public string getDocComment ( void ) public int getModifiers ( void ) public string getName ( void ) public mixed getValue ([ string $object ] ) public bool isDefault ( void ) public bool isPrivate ( void ) public bool isProtected ( void ) public bool isPublic ( void ) public bool isStatic ( void ) public void setAccessible ( bool $accessible ) public void setValue ( object $object, mixed $value ) public string __toString ( void )

ReflectionExtension  ReflectionExtension implements Reflector  Свойства public $name ;  Методы public static string export ( string $name [, string $return = false ] ) public array getClasses ( void ) public array getClassNames ( void ) public array getConstants ( void ) public array getDependencies ( void ) public array getFunctions ( void ) public array getINIEntries ( void ) public string getName ( void ) public string getVersion ( void ) public string info ( void ) public string __toString ( void )

Лабораторная работа Файл reflection\index.php 1 1 Ознакомьтесь с ВВОДНЫМИ ДАННЫМИ 2 2 Уясните ЗАДАНИЕ 3 3 Использование Reflection Выполните задания

Выводы Reflection