SlideShare une entreprise Scribd logo
1  sur  2
Leonardo Enrique Ibarra Becerra<br />Maestría en Sistemas y Computación<br />Desarrollo de Software Basado en Modelos<br />Purpose<br />The purpose of this exercise is to master the Object Constraint Language<br />This example was taken from: Jos Warmer in the OMG Advanced UML Modelling Tutorial. www.omg.org/docs/omg/01-03-04.ppt<br />General Class Diagram<br />Exercise 1<br />1. All flight objects must have a duration attribute that is less than four<br />context Flight inv:<br />self.duration < 4<br />2. The maximum number of passengers on any flight may not exceed 1000<br />context Flight inv:<br />self.maxNrPassengers  <= 1000<br />ó<br />context Flight inv:<br />self.passengers->size() <= 1000<br />3. For every passenger the age attribute must be greater than or equal to the class attribute minAge<br />context Flight inv:<br />self.age  >= self.minAge<br />4. The duration attribute of all flight objects must be equal to the difference between the arrivalTime attribute and the departTime attribute<br />context Flight inv:<br />self.duration  = self.arrivalTime – self.departTime<br />5. The airport from which a flight is leaving is different from the destination airport.<br />context Flight inv:<br />self.origin  <> self.destination<br />6. For every flight the name of the airport from which it is leaving, must be “Amsterdam”.<br />context Flight inv:<br />self.origin.name  = ‘Amsterdam’<br />7. For every flight the name of the airline must be “KLM”.<br />context Flight inv:<br />self.airline.name  = ‘KLM’<br />
Ocl exercises 1

Contenu connexe

Tendances

Tendances (20)

Support Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFISupport Web Services SOAP et RESTful Mr YOUSSFI
Support Web Services SOAP et RESTful Mr YOUSSFI
 
Introduction à ASP.NET
Introduction à ASP.NETIntroduction à ASP.NET
Introduction à ASP.NET
 
Geti 2101 activity_diagrams
Geti 2101 activity_diagramsGeti 2101 activity_diagrams
Geti 2101 activity_diagrams
 
Introduction to JavaFX
Introduction to JavaFXIntroduction to JavaFX
Introduction to JavaFX
 
Polymorphisme (cours, résumé)
Polymorphisme (cours, résumé)Polymorphisme (cours, résumé)
Polymorphisme (cours, résumé)
 
.NET Framework
.NET Framework.NET Framework
.NET Framework
 
Fiche de TP 3 sur les bases de données avec les SGBD(Système de Gestion des B...
Fiche de TP 3 sur les bases de données avec les SGBD(Système de Gestion des B...Fiche de TP 3 sur les bases de données avec les SGBD(Système de Gestion des B...
Fiche de TP 3 sur les bases de données avec les SGBD(Système de Gestion des B...
 
Systèmes multi agents concepts et mise en oeuvre avec le middleware jade
Systèmes multi agents concepts et mise en oeuvre avec le middleware jadeSystèmes multi agents concepts et mise en oeuvre avec le middleware jade
Systèmes multi agents concepts et mise en oeuvre avec le middleware jade
 
Cours ocl
Cours oclCours ocl
Cours ocl
 
Approche Mda
Approche MdaApproche Mda
Approche Mda
 
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFITheses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
Theses Soutenues sous Direction et Co-Direction du Pr YOUSSFI
 
Introduction à l’orienté objet en Python
Introduction à l’orienté objet en PythonIntroduction à l’orienté objet en Python
Introduction à l’orienté objet en Python
 
OpenESB et BPEL
OpenESB et BPELOpenESB et BPEL
OpenESB et BPEL
 
Chp1 intro conception
Chp1 intro conceptionChp1 intro conception
Chp1 intro conception
 
Les web services
Les web servicesLes web services
Les web services
 
UML Part2- diagramme des uses cases_mansouri
UML Part2- diagramme des uses cases_mansouriUML Part2- diagramme des uses cases_mansouri
UML Part2- diagramme des uses cases_mansouri
 
Ch 01 poo
Ch 01 pooCh 01 poo
Ch 01 poo
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Cours design pattern m youssfi partie 1 introduction et pattern strategy
Cours design pattern m youssfi partie 1 introduction et pattern strategyCours design pattern m youssfi partie 1 introduction et pattern strategy
Cours design pattern m youssfi partie 1 introduction et pattern strategy
 
Tp3 - UML
Tp3 - UMLTp3 - UML
Tp3 - UML
 

En vedette

Spr ue3.1 poly cours et exercices
Spr ue3.1   poly cours et exercicesSpr ue3.1   poly cours et exercices
Spr ue3.1 poly cours et exercices
Elsa von Licy
 
Exercice nombres complexes
Exercice nombres complexesExercice nombres complexes
Exercice nombres complexes
Yessin Abdelhedi
 
Environnement de développement de bases de données
Environnement de développement de bases de donnéesEnvironnement de développement de bases de données
Environnement de développement de bases de données
ISIG
 
La &amp; edm in practice
La &amp; edm in practiceLa &amp; edm in practice
La &amp; edm in practice
bharati k
 

En vedette (20)

OCL tutorial
OCL tutorial OCL tutorial
OCL tutorial
 
OCL in EMF
OCL in EMFOCL in EMF
OCL in EMF
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCL
 
Révision chapitre 5 : Électricité et magnétisme
Révision chapitre 5 : Électricité et magnétismeRévision chapitre 5 : Électricité et magnétisme
Révision chapitre 5 : Électricité et magnétisme
 
BEEM magnetic microscopy - Data Storage
BEEM magnetic microscopy - Data StorageBEEM magnetic microscopy - Data Storage
BEEM magnetic microscopy - Data Storage
 
Ch3 cm et transf
Ch3 cm et transfCh3 cm et transf
Ch3 cm et transf
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
Nrgastro.2011.105
Nrgastro.2011.105Nrgastro.2011.105
Nrgastro.2011.105
 
Chapitre 1 electrotech mli
Chapitre 1 electrotech mliChapitre 1 electrotech mli
Chapitre 1 electrotech mli
 
Spr ue3.1 poly cours et exercices
Spr ue3.1   poly cours et exercicesSpr ue3.1   poly cours et exercices
Spr ue3.1 poly cours et exercices
 
Chapitre 5 : Magnétisme - cours 1
Chapitre 5 : Magnétisme - cours 1Chapitre 5 : Magnétisme - cours 1
Chapitre 5 : Magnétisme - cours 1
 
Exercice nombres complexes
Exercice nombres complexesExercice nombres complexes
Exercice nombres complexes
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
 
Modeling the OCL Standard Library
Modeling the OCL Standard LibraryModeling the OCL Standard Library
Modeling the OCL Standard Library
 
OCCIware Contribution to the EU consultation on Cloud Computing Research Inno...
OCCIware Contribution to the EU consultation on Cloud Computing Research Inno...OCCIware Contribution to the EU consultation on Cloud Computing Research Inno...
OCCIware Contribution to the EU consultation on Cloud Computing Research Inno...
 
Timing verification of automotive communication architecture using quantile ...
Timing verification of automotive communication  architecture using quantile ...Timing verification of automotive communication  architecture using quantile ...
Timing verification of automotive communication architecture using quantile ...
 
Environnement de développement de bases de données
Environnement de développement de bases de donnéesEnvironnement de développement de bases de données
Environnement de développement de bases de données
 
Aligning OCL and UML
Aligning OCL and UMLAligning OCL and UML
Aligning OCL and UML
 
Model Transformation: A survey of the state of the art
Model Transformation: A survey of the state of the artModel Transformation: A survey of the state of the art
Model Transformation: A survey of the state of the art
 
La &amp; edm in practice
La &amp; edm in practiceLa &amp; edm in practice
La &amp; edm in practice
 

Similaire à Ocl exercises 1

Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and views
priestc
 
In this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdfIn this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdf
ivylinvaydak64229
 
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
Yasar UCKUN
 
Skytech-Solutions-Projects
Skytech-Solutions-ProjectsSkytech-Solutions-Projects
Skytech-Solutions-Projects
Lakshmi Sreejith
 

Similaire à Ocl exercises 1 (20)

Models, controllers and views
Models, controllers and viewsModels, controllers and views
Models, controllers and views
 
Flight Stimulator PPt.pptx
Flight Stimulator PPt.pptxFlight Stimulator PPt.pptx
Flight Stimulator PPt.pptx
 
FWSTC Brochure
FWSTC BrochureFWSTC Brochure
FWSTC Brochure
 
In this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdfIn this assignment you will practice creating classes and enumeratio.pdf
In this assignment you will practice creating classes and enumeratio.pdf
 
Standoutfromthe crowds
Standoutfromthe crowdsStandoutfromthe crowds
Standoutfromthe crowds
 
Airline reservation system 1
Airline reservation system 1Airline reservation system 1
Airline reservation system 1
 
amar_resume
amar_resumeamar_resume
amar_resume
 
Csci 1101 computer science ii assignment 3/tutorialoutlet
Csci 1101 computer science ii assignment 3/tutorialoutletCsci 1101 computer science ii assignment 3/tutorialoutlet
Csci 1101 computer science ii assignment 3/tutorialoutlet
 
Simulation_Final_Project_Grp6.pptx
Simulation_Final_Project_Grp6.pptxSimulation_Final_Project_Grp6.pptx
Simulation_Final_Project_Grp6.pptx
 
Airline reservation system db design
Airline reservation system db designAirline reservation system db design
Airline reservation system db design
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Airline reservation system
Airline reservation systemAirline reservation system
Airline reservation system
 
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
Scenario-Based Training.ppt YASAR [Otomatik kaydedilme]
 
Air ticket reservation system presentation
Air ticket reservation system presentation Air ticket reservation system presentation
Air ticket reservation system presentation
 
AODP-Flyer
AODP-FlyerAODP-Flyer
AODP-Flyer
 
Flutter Forward EXTENDED - Flutter로 앱 개발 입문하기
Flutter Forward EXTENDED -  Flutter로 앱 개발 입문하기Flutter Forward EXTENDED -  Flutter로 앱 개발 입문하기
Flutter Forward EXTENDED - Flutter로 앱 개발 입문하기
 
A06
A06A06
A06
 
ThunderCats_Revised_2
ThunderCats_Revised_2ThunderCats_Revised_2
ThunderCats_Revised_2
 
VB Script Overview
VB Script OverviewVB Script Overview
VB Script Overview
 
Skytech-Solutions-Projects
Skytech-Solutions-ProjectsSkytech-Solutions-Projects
Skytech-Solutions-Projects
 

Ocl exercises 1

  • 1. Leonardo Enrique Ibarra Becerra<br />Maestría en Sistemas y Computación<br />Desarrollo de Software Basado en Modelos<br />Purpose<br />The purpose of this exercise is to master the Object Constraint Language<br />This example was taken from: Jos Warmer in the OMG Advanced UML Modelling Tutorial. www.omg.org/docs/omg/01-03-04.ppt<br />General Class Diagram<br />Exercise 1<br />1. All flight objects must have a duration attribute that is less than four<br />context Flight inv:<br />self.duration < 4<br />2. The maximum number of passengers on any flight may not exceed 1000<br />context Flight inv:<br />self.maxNrPassengers <= 1000<br />ó<br />context Flight inv:<br />self.passengers->size() <= 1000<br />3. For every passenger the age attribute must be greater than or equal to the class attribute minAge<br />context Flight inv:<br />self.age >= self.minAge<br />4. The duration attribute of all flight objects must be equal to the difference between the arrivalTime attribute and the departTime attribute<br />context Flight inv:<br />self.duration = self.arrivalTime – self.departTime<br />5. The airport from which a flight is leaving is different from the destination airport.<br />context Flight inv:<br />self.origin <> self.destination<br />6. For every flight the name of the airport from which it is leaving, must be “Amsterdam”.<br />context Flight inv:<br />self.origin.name = ‘Amsterdam’<br />7. For every flight the name of the airline must be “KLM”.<br />context Flight inv:<br />self.airline.name = ‘KLM’<br />