Università degli Studi di Roma Tor Vergata Facoltà di Ingegneria Corso di Laurea in Ingegneria Informatica. Programmazione orientata agli Oggetti



Documenti analoghi
Università degli Studi di Roma Tor Vergata Facoltà di Ingegneria Corso di Laurea in Ingegneria Informatica. Programmazione Orientata agli Oggetti

Finite Model Theory / Descriptive Complexity: bin

NATIONAL SPORT SCHOOL

A.A. 2006/2007 Laurea di Ingegneria Informatica. Fondamenti di C++ Horstmann Capitolo 3: Oggetti Revisione Prof. M. Angelaccio

COLLOCATIONS. Match the nouns on the right column with the most appropriate adjective in current Italian:

U Corso di italiano, Lezione Quattordici

UNIVERSITÀ DEGLI STUDI DI TORINO

Online Resource 12: Dataset

Information Risk Management (IRM)

Single-rate three-color marker (srtcm)

How to register online for exams (Appelli) Version updated on 23/10/2017

Fondamenti di Informatica Esercitazione 8/5/2014

College Algebra. Logarithms: Denitions and Domains. Dr. Nguyen November 9, Department of Mathematics UK

NATIONAL SPORT SCHOOL ST CLARE COLLEGE

ECOLE POLYTECHNIQlE FEDERALE DE LAUSANNE

Introduciamo l'uso della programmazione ad oggetti in PHP...perchè si può fare!

CATALOGO PARTI DI RICAMBIO SPARE PARTS CATALOGUE CATALOGUE DES PIECES DE RECHANGE ERSATZTEILKATALOG N..92. IT Modulo RICHIESTA DI GARANZIA

Filling in the online career plan Version updated on 25/10/2017

EC11 ANNO ACCADEMICO 2013/2014 CORSO DI LAUREA IN ECONOMIA, COMMERCIO INTERNAZIONALE e MERCATI FINANZIARI

How to register for exam sessions ( Appelli ) Version updated on 17/10/2018

Esercizi design patterns. Angelo Di Iorio,

Cost Saving con la Ricerca Intelligente

Call For Scores. Il Contrabbasso Contemporaneo

FISE Federazione Italiana Sport Equestri

MLTAQ Sunshine Coast Branch SPEECH CONTEST 2017 Year 4 Italian Speech. Il mio numero di telefono è. (single digits) (Non) Ho fratelli e sorelle.

Database support Prerequisites Architecture Driver features Setup Stored procedures Where to use. Contents

NOTICE. Palladium Securities 1 S.A. Series 112 EUR 100,000,000 Fixed to Floating Rate Instruments due 2023 (with EUR

Algoritmi Priority-Driven RT. Corso di Sistemi RT Prof. Davide Brugali Università degli Studi di Bergamo

Introduction. The Structure of a Compiler

Immigrazione Studiare

nel mondo del caffè, che spinge in avanti i confini del possibile.

Analisi dei Requisiti, Progettazione Preliminare ed Esecutiva di Grandi Sistemi Ingegneristici: Casi di Studio

How to use the verb Piacere.

Simboli su illustrazioni a piena pagina strategia 2: «sfondo trasparente"

Fiori di campo. Conoscere, riconoscere e osservare tutte le specie di fiori selvatici più note

Testi del Syllabus. Docente POGGI AGOSTINO Matricola:

Ammissibilità di co.co.co. e AdR in H2020. Laura Fulci Dirigente Area Ricerca Politecnico di Torino

29/02/2016. How to Access MyEconLab. Getting started: XL2A-41W1-901Z-4NT2. (included with your textbook) (Scienze e tecn. Ristorazione) 1.

MI frontespizio R OR

Brandon Brown vuole un cane

living FINITURE PER INTERNI INTERIOR FINISHES

Il concetto di varietà e la nascita della teoria degli insiemi RIEMANN ( )

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

Downloading and Installing Software Socio TIS

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

WEB OF SCIENCE. COVERAGE: multidisciplinary TIME RANGE: DOCUMENT TYPES: articles, proceedings papers, books

Percorsi: L'Italia Attraverso La Lingua E La Cultura, Books A La Carte Plus MyItalianLab By Francesca Italiano, Irene Marchegiani READ ONLINE

Keep calm, observe and assess

Impostazioni iniziali symwriter2. a cura di Antonio Bianchi Novembre 2017

Pearson VUE. Richiesta Authorization to Test (ATT) ed eventuale successiva schedulazione dell esame

Materiale Didattico 2010 La gestione del tempo Marco Fida

La storia del progetto, dagli USA alla esperienza dell Ospedale S. Croce di Cuneo -

Corso di inglese. Livello A.1 principiante. Obiettivi del corso e descrizione del livello

LA SACRA BIBBIA: OSSIA L'ANTICO E IL NUOVO TESTAMENTO VERSIONE RIVEDUTA BY GIOVANNI LUZZI

XV SCRITTURA E IMMAGINE INTERNATIONAL SHORT FILM FESTIVAL 15 INTERNATIONAL SHORT FILM FESTIVAL SCRITTURA E IMMAGINE

Chapter 7 Registers and Register Transfers

BUON GIORNO RAGAZZI! Oggi è il 13 ottobre, 2015

SHOP ONLINE TWISTED XL BORN IN ITALY. ARCHITECTURAL BODY designed to embody. collezione 2015

Centro sovrazonale di comunicazione aumentativa. Modificare i PDF. a cura di Antonio Bianchi Novembre 2017

IM-IU v0.1. alternata e continua. pag. 1 / 5

6.5 RNA Secondary Structure

STUDENT NUMBER Letter ITALIAN. Written examination. Tuesday 22 November 2011

Curriculum Amministrazione e controllo ( 1 ) I anno 002EC Economia aziendale 12 SECS-P/07 Base Aziendale

Esercizi Svolti Di Programmazione Lineare Tomo G Pag 421 E

Accordi di 3 note / Accordi Maggiori Triade Maggiore. Settima Maggiore Si ottiene con la triade minore sul terzo grado: C maj7 = Mi m / Do

Curriculum Amministrazione e controllo (¹) Scelta libera * D EC Idoneità informatica INF/01 F 3 1

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

La centralità di SharePoint 2013 nelle organizzazioni: perchè? Fabio Santini Direttore divisione Server, Tools and Cloud Microsoft Italia

Elaborazione di documenti XML

COMUNITA TERAPEUTICA IL FARO

ikami C&D+ La Suite a supporto delle PMI 4.0 ikami Strada del Meisino, 51 Torino, TO

Oracle Retail MICROS Stores2 Functional Document Customers - Homonyms Release March 2016

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

FORM 3 (3rd year) ITALIAN TIME: 6 minutes ORAL EXAMINATION. EXAMINER S PAPER Groups A & B

Graphs: Cycles. Tecniche di Programmazione A.A. 2012/2013

Per le persone fisiche: For natural persons: Per le persone giuridiche: For legal persons: Denominazione: COMUNE DI BOLOGNA.

LA SACRA BIBBIA: OSSIA L'ANTICO E IL NUOVO TESTAMENTO VERSIONE RIVEDUTA BY GIOVANNI LUZZI

Change Notice/ Avviso di modifica ACLS Instructor Manual/Supporto Vitale Cardiovascolare Avanzato (ACLS) Manuale per l istruttore

PROGRAMMAZIONE DISCIPLINARE 2017/2018 LINGUA E CIVILTA INGLESE AB24. CLASSI PRIME TECNICO DOCENTI: Belletti Nunzia, Lopes Francesca

SLIM IRONY LOW TABLES design: Maurizio Peregalli 2016

HALF YEARLY EXAMINATIONS CLUSTERING FEBRUARY FORM 3 (1st year) ITALIAN TIME: 6 min ORAL EXAMINATION EXAMINER S PAPER (GROUPS A & B)

European Patent Litigation Certificate EPLC. COMMENTI SICPI SU RULES 11 E 12

UNIVERSITÀ DEGLI STUDI DI TORINO

LASER SAFETY WINDOWS

UML: Aggregazione. class A { int s; public void sets(int){ }; public int gets() { }; class B {A ob; public void usea() { }; }

Paolo Sospiro Università di Macerata Crescita I: Macerata 28 Settembre 2017 Economia dello Sviluppo Università di Macerata

Coordinamento Nazionale tra i Corsi di Studio in Pianificazione e Urbanistica

Corso di Laurea in Informatica a.a

Curriculum AMMINISTRAZIONE E CONTROLLO ( 1 ) I anno (60 CFU)

F14MD F18MD. Modular filters, suitable for compressed air FEATURES. Filter for inlet pressure up to 30 bar (435 psi).

ISTI ISTI Pisa. Trasportare algoritmi di partizionamento di oggetti in ambito teoria dei concetti. Elvira Locuratolo & Jari Palomaki.

Semantica Operazionale del linguaggio imperativo IMP

Forte!: Libro Dello Studente Ed Esercizi + CD 1 (Level A1) (Italian Edition)

CREDITI per i CORSI ITALIANO ERASMUS A.A

Curriculum Amministrazione e controllo ( 1 )

PIANO DI STUDI. Primo anno di corso

DATABASE PER IL WEB. Programmazione Web 1

6 POSITIONS SEALED CONNECTOR FOR MICRO TIMER II CONTACT

Il Canile Come Presidio Zooantropologico (Italian Edition) By Roberto Marchesini

LUGANO TROPHY - 16 MEMORIAL MARIO ALBISETTI GARA INTERNAZIONALE DI MARCIA Lugano (Svizzera) Domenica 17 marzo 2019

Transcript:

Università degli Studi di Roma Tor Vergata Facoltà di Ingegneria Corso di Laurea in Ingegneria Informatica Programmazione orientata agli Oggetti OOP L 06b 1

L06b: Metamorfosi 2

Metamorfosi? Vuol dire che un oggetto può cambiare l insieme degli stati e/o comportamenti possibili durante la sua vita. In La metamorfosi di F. Kafka un uomo, il personaggi principale, diventa uno scarafaggio. Nell asino d oro di Apuleio (II sec.), Lucio, per la curiosità nei confronti delle pratiche magiche, viene accidentalmente trasformato in asino, invece che in uccello come avrebbe desiderato. In Le Metamorfosi di Ovidio, il matrimonio, trasforma i due sposi, le loro attese e desideri in un insieme di esperienze, di gioie e dolori condivisi. 3

What is Metamorphosis? Metamorphosis 1. a change in form, structure, or function; specifically the physical change undergone by some animals, as of the tadpole to the frog. 2. any marked change, as in character, appearance, or condition. ~ Webster s New World Dictionary, Simon & Schuster, Inc., 1979

Metamorfosi vs. OOP Le metamorfosi esistono nel mondo reale. Q1: È una delle trasformazioni elementari previste dalla OOP? Q1.1: Se no come modellarla? Per i linguaggi OOP basati su classi oggi disponibili la risposta a Q1 è NEGATIVA. 5

Example: Metamorphosis In the university, there are full time students and part time students Full time students have an expected graduation date but part time students do not Part time students may take a maximum of 3 courses where there is no maximum for full time students ParttimeStudent name address studentid maxnumcourses FulltimeStudent name address studentid graddate OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro

What happens if a part-time time student becomes a full-time student? OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro

Modeling Metamorphosis Inheritance may be used to model common structure, behavior and/or relationships to the changing parts OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro

Modeling Metamorphosis: One Approach A generalization relationship may be created Student name address studentid ParttimeStudent maxnumcourses FulltimeStudent graddate OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro 9

Modeling Metamorphosis: One Approach? : Student Manager s : Parttime Classification temp : Fulltime Classification Create ((Student(s:ParttimeClassification, ) setremaining( ) s=temp Delete(s) 10

Modeling Metamorphosis: One Approach Student name address studentid ParttimeStudentFulltimeStudent maxnumcoursesgraddate : Student Manager s : Parttime Classification temp : Fullti Classificatio Create ((Student(s:ParttimeClassification, setremaining( ) s=temp delete 11

Modeling Metamorphosis: One Approach C è di meglio! Student name address studentid ParttimeStudentFulltimeStudent maxnumcoursesgraddate : Student Manager s : Parttime Classification temp : Fullti Classificatio Create ((Student(s:ParttimeClassification, setremaining( ) s=temp delete 11

Modeling Metamorphosis: Another Approach Inheritance may be used to model common structure, behavior and/or relationships to the changing parts Student name address studentid Student name address studentid 1 1 Classification ParttimeStudent maxnumcourses FulltimeStudent graddate FulltimeClassification graddate ParttimeClassification maxnumcourses OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro 12

Modeling Metamorphosis: Another Approach (contd) Metamorphosis is accomplished by the object talking to the changing parts : Student Manager : Student : Parttime : Fulltime Classification Classification change to full time delete create OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro 13

Metamorphosis and Flexibility This 2 nd technique also adds to the flexibility of the model ResidentInformation dorm room roomkeyid 0..1 1 Student name address studentid 1 1 Classification A student may also live on campus FulltimeClassification graddate ParttimeClassification maxnumcourses OOAD Using the UML - Architectural Design, v 4.2 Copyright 1998-1999 Rational Software, all rights reserved G.Calavaro 14

Esercizio Fra i Raneidi, Il Girino - larva acquatica a respirazione branchiale e, peraltro, muta - dopo 30 gg. dalla nascita (*) si trasforma nell anfibio Rana capace, peraltro, di camminare e gracchiare, oltre che a suo modo - nuotare. Modellare la crescita di un Girino, la sua trasformazione in Rana, e scrivere un programma di test. (*) Dato tutto da verificare!!! 15

Esercizio Di una classe Persona, siano Bambino e Ragazzo due classi derivate. Persona possegga il metodo giornodicompleanno(), il quale provochi l incremento dell età dell oggetto destinatario. Un Bambino, a partire dal suo 14 o anno d età, acquisisca il comportamento boolean haiilmotorino() che restituisce true se e solo se il destinatario possiede tale mezzo di locomozione. Modellare la crescita di una Persona e scrivere un programma di test. 16