120, 200 x. r1 = 25. virtua void translate (int dx, dy) = 0; virtual void dessiner(graphics &g) = 0;



Similar documents
POB-JAVA Documentation

Output: struct treenode{ int data; struct treenode *left, *right; } struct treenode *tree_ptr;

Translating to Java. Translation. Input. Many Level Translations. read, get, input, ask, request. Requirements Design Algorithm Java Machine Language

Moving from CS 61A Scheme to CS 61B Java

CMSC 132: Object-Oriented Programming II. Design Patterns I. Department of Computer Science University of Maryland, College Park

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering

Brazil + JDBC Juin 2001, douin@cnam.fr

Langages Orientés Objet Java

C++FA 5.1 PRACTICE MID-TERM EXAM

ABSTRACT FACTORY AND SINGLETON DESIGN PATTERNS TO CREATE DECORATOR PATTERN OBJECTS IN WEB APPLICATION

Stacks. Linear data structures

Part I. Multiple Choice Questions (2 points each):

User Guide Thank you for purchasing the DX90

MXwendler Javascript Interface Description Version 2.3

2.3 WINDOW-TO-VIEWPORT COORDINATE TRANSFORMATION

Générer des graphiques 3D - Cours Université de Sfax

UIL Computer Science for Dummies by Jake Warren and works from Mr. Fleming

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty("java.security.policy","../server.java.

WPF Shapes. WPF Shapes, Canvas, Dialogs 1

CS 141: Introduction to (Java) Programming: Exam 1 Jenny Orr Willamette University Fall 2013

JAVA Program For Processing SMS Messages

J a v a Quiz (Unit 3, Test 0 Practice)

15-214: Principles of Software Construction 8 th March 2012

Le(s) auteur(s) par la presente cede(nt) a. I'IFIP en toute exclusivite et dans tous les pays tous les droits relatifs a. l'oeuvre

How To Write A Program In Java (Programming) On A Microsoft Macbook Or Ipad (For Pc) Or Ipa (For Mac) (For Microsoft) (Programmer) (Or Mac) Or Macbook (For

Topic 11 Scanner object, conditional execution

History OOP languages Year Language 1967 Simula Smalltalk

Thursday, February 7, DOM via PHP

Help on the Embedded Software Block

Example of a Java program

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

Retour vers le futur des bibliothèques de squelettes algorithmiques et DSL

Twin A Design Pattern for Modeling Multiple Inheritance

Realizing Enterprise Integration Patterns in WebSphere

SSLV105 - Stiffening centrifuges of a beam in rotation

Liste d'adresses URL

Visual Analysis of Network Traffic for Resource Planning, Interactive Monitoring, and Interpretation of Security Threats

CompSci 125 Lecture 08. Chapter 5: Conditional Statements Chapter 4: return Statement

2009 Tutorial (DB4O and Visual Studio 2008 Express)

Recursion. Definition: o A procedure or function that calls itself, directly or indirectly, is said to be recursive.

PIC 10A. Lecture 7: Graphics II and intro to the if statement

SUBJECT CANADA CUSTOMS INVOICE REQUIREMENTS. This Memorandum explains the customs invoice requirements for commercial goods imported into Canada.

MiniDraw Introducing a framework... and a few patterns

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!

TP JSP : déployer chaque TP sous forme d'archive war

Iterator Pattern. CSIE Department, NTUT Chien-Hung Liu. Provide a way to access the elements of an aggregate object sequentially

Introduction to Java

Iterators. Provides a way to access elements of an aggregate object sequentially without exposing its underlying representation.

The separation principle : a principle for programming language design

AP Computer Science Java Subset

Design Patterns. Advanced Software Paradigms (A. Bellaachia) 1

CmpSci 187: Programming with Data Structures Spring 2015

D06 PROGRAMMING with JAVA. Ch3 Implementing Classes

READ AND FOLLOW ALL SAFETY INSTRUCTIONS 1. DANGER RISK OF SHOCK DISCONNECT POWER BEFORE INSTALLATION

Supporting Data Set Joins in BIRT

Sample CSE8A midterm Multiple Choice (circle one)

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Unit Testing & JUnit

! Sensors in Android devices. ! Motion sensors. ! Accelerometer. ! Gyroscope. ! Supports various sensor related tasks

Advanced Techniques for Mobile Robotics Robot Software Architectures. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz

Adobe Marketing Cloud Data Workbench Report Server

Chapter 14 The Binary Search Tree

Big Data and Big Analytics

Binary Search Trees (BST)

It has a parameter list Account(String n, double b) in the creation of an instance of this class.

Annexe - OAuth Introduction. Xavier de Rochefort xderoche@labri.fr - labri.fr/~xderoche 15 mai 2014

Introduction. GEAL Bibliothèque Java pour écrire des algorithmes évolutionnaires. Objectifs. Simplicité Evolution et coévolution Parallélisme

Lecture Notes on Binary Search Trees

DHI a.s. Na Vrsich 51490/5, , Prague 10, Czech Republic ( t.metelka@dhi.cz, z.svitak@dhi.cz )

The Java I/O System. Binary I/O streams (ascii, 8 bits) The decorator design pattern Character I/O streams (Unicode, 16 bits)

CORBA Programming with TAOX11. The C++11 CORBA Implementation

A Pattern for Designing Abstract Machines

COSC Introduction to Computer Science I Section A, Summer Question Out of Mark A Total 16. B-1 7 B-2 4 B-3 4 B-4 4 B Total 19

Overview of Web Services API

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Power Distribution System. Additional Information on page 2 See Page 2 Page 6. Eaton. See Page 2. Additional Information on page 2

Contents. 9-1 Copyright (c) N. Afshartous

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Intel Retail Client Manager Audience Analytics

«Object-Oriented Multi-Methods in Cecil» Craig Chambers (Cours IFT6310, H08)

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Réponse à une question de Roger Bastide Document 40

1. La classe Connexion class Connexion {

Introduction to Programming (in C++) Multi-dimensional vectors. Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC

Designing and Writing a Program DESIGNING, CODING, AND DOCUMENTING. The Design-Code-Debug Cycle. Divide and Conquer! Documentation is Code

Chapter 15 Functional Programming Languages

Teacher Page. 1. Reflect a figure with vertices across the x-axis. Find the coordinates of the new image.

>

Probabilistic Assertions

How to create a SMTP plugin for ArGoSoft Mail Server,.NET edition (AMS.NET edition) using Visual Studio 2005

TP : Système de messagerie - Fichiers properties - PrepareStatement

The Tower of Hanoi. Recursion Solution. Recursive Function. Time Complexity. Recursive Thinking. Why Recursion? n! = n* (n-1)!

Getting Started with the Internet Communications Engine

Virtuozzo Virtualization SDK

Transcription:

Adresse : Yann.Thierry-Mieg@Lip6.fr 1. COO par lʼexemple 100,50 a, 30 120, 200 x r1 = 25 Graphics Dessin translater(dx, dy) dessiner(g) drawline(x,y,h,l) drawellipse fillrect setcolor setbgcolor() * <interface> * Forme virtua void translate (int dx, dy) = 0; virtual void dessiner(graphics &g) = 0; Carre int x,u; int a, void dessiner (Graphics g) void translater (int dx, int dy) Cercle int x,y; int r; dessiner(); translater();

class carre { " int x; " int y; " int a; " " public : " Carre( int x, int y, int a) :x(x),y(y),a(a) " void dessiner(graphic &g){ g.drarect(x,y,a,a);} " void translate (int dx, int dy){x += dx; y += yx;} }; class cercle { " int x; " int y; " int r; " " public : " Carre( int x, int y, int a) :x(x),y(y),r(a) " void dessiner(graphic &g){ g.drawelllipset(x,y,x,y,r);} " void translate (int dx, int dy){x += dx; y += yx;} }; class Dessin { " typedef vector <Forme *> formes_t " typedef formes_t::iterator formes_it; " formes_t formes; " public : " void dessiner (graphics &g){ " " for(formes_it it = formes.begin(); it!= formes.end(); ++it){ (*it)-> dessiner(g);}} " void translate(int dx, int dy){ " for(formes_it it = formes.begin(); it!= formes.end(); ++it){ (*it)-> translate(dx,dy);}} }; Si dessin hérite de form alors class Dessin : public Forme { " typedef vector <Forme *> formes_t " typedef formes_t::iterator formes_it; " formes_t formes; " public : " void dessiner (graphics &g){ " " for(formes_it it = formes.begin(); it!= formes.end(); ++it){ (*it)-> dessiner(g);}} " void translate(int dx, int dy){ " for(formes_it it = formes.begin(); it!= formes.end(); ++it){ (*it)-> translate(dx,dy);}} }; interface -> que des méthodes virtuelles pure graphique

typedef vector <int> tab_t typedef tab_t :: iterator tab_it; tab_t tab; for(tab_it.it = tab.begin(); it!= tab.end(); ++it){cout <<*it;} OU typedef list <int> tab_t typedef tab_t :: iterator tab_it; for(tlist <int>::iteraot it = tab.begin(); it!= tab.end(); ++it){cout <<*it;} Design Pattern Composite Dessin Dessin Dessin Carre Cercle Dessin * Node Composite Leaf

2. Encapsulation, délégation, héritage interface evenements noyaux m1() Dépendance fonctionelle // opération dans leur signature vs structurelle //attributs structures de données délégation A délègue le traitement m sur B return leb->m1(); A m1(); leb B m1();

3. Design Patterns «Design Patterns, elements of reusable software...» Gauna, Johnson, Vkissides,... 95 y.mieg.free.fr/uml/gof.zip maintenabilité, évolutivité, flexibilité, encapsulation Créationnels Factory / AbstractFactory Singleton Structurels Façade Composite Proxy Decorator Comportemantaux Observes Iterator Factory c client Forme dépendances Carre Cercle Rectangle FormeFactory static Forme * createcarre(x,y,a) static Forme * createcercle(x,y,r) staticforme * createrectangle(x,y,l,h) return new Carre(x,y,a) Rectangle(x,y,a);

Forme xf = new Carre(100,150,30); FormeFactory::createCarre(100,150,30); Composite e = True ^(False v - True) ^ True v not False True ExprBool bool eval() = 0; Or And True False Not eval(); eval() eval() ; bool eval() eval() return l -> eval() r->eval() return l -> eval() && r->eval() return op -> eval()

4. y.mieg.free.fr/efrei-dp/ Produit Qte int qte getprix getref getdesc 1 * < interface > Produit string getref() string getdesc() double getprix() Produit Compose ref desc Produit Simple ref desc prix Somme prix des composants

Produit *jante = new PS(«J01», «jante», 12); Produit *rayon = new PS(3ROI», «rayon», 0.2); ProduitCompose *roue = new PC(«RR12», «roue»); roue-> addcomposant(jante,1) roue->addcomposant(rayon,30); cout<<roue->getprix(); void addcomposant(produit *p, int Qte) { if(qte == 1) Composant.push_back(p) else Composant.pushback(new PQ(p,qte)); } 5. La façade interface Encapuslation c1 c2 c3 classe classe classe classe

classe classe classe classe Facade c1 c2 c3

6. Proxy Virtual Proxy Client * Image getdim() render() Image JPG ImageJPG(path) concret getdim() render() ImageProxy string path dimension setdim() render() return dimension if(concret == NULL) concret = new ImgJPG(path) return concret->render; Proxy Sécurité client Connection if(ip appartient blacklist) râle râle socket --> connect (ip) Coonect(IP) Send(msg) Socket 1 Socket Filtre blacklist Connect() Send(msg) concret -> send(msg)

Proxy réseau client Objet m1(); Objet implemante Proxy m1(); m1(); Inet

7. Decorateur client Component draw() getdim() 1 Panel 3D Border ScrollPane getdim(); draw(); getdim(); return pane->getdim() + (5,5) Forme dessiner(g) 1 Dessin FormeColore color dessin(g)

8. Iterator *it begin()" " " " " it" " " " " " end() collection begin():iterator end():iterator iterator operator++ operator * operator == list, dequeue, set, hash-set ou for(vector<int>::iterator it = tab.begin(); it!= tab.end(); ++it) cout<<*it;

9. Observer 10.