DEX is a generator for (parts of) business applications Input: Class Diagram, (OCL constraints) Generated result Running application.

Size: px
Start display at page:

Download "DEX is a generator for (parts of) business applications Input: Class Diagram, (OCL constraints) Generated result Running application."

Transcription

1 Farbe! Generative Software Engineering «interface» Interface Class Type attribute 1 role CD Class * 2. Generating Data Explorers composition Type method() qualifier qualified_association Prof. Dr. Bernhard Rumpe Page 2 Data Explorer (DEX) DEX is a generator for (parts of) business applications Input: Class Diagram, (OCL constraints) Generated result Running application UML/P CD DEX generator textual class diagram Java Swing Application We use DEX to study how a generator works how to adapt and extend it s components

2 Farbe! Generative Software Engineering «interface» Interface Class Type attribute 1 role CD 2. Generating Data Explorers 2.1. Class Diagrams as Input Class composition Type method() qualifier qualified_association * Prof. Dr. Bernhard Rumpe Page 4 Class Diagrams We assume that you are familiar with CDs, here a short overview (and excerpt of our case study Social Network ): this is a class diagram Relationship boolean pending Date requested Date accepted 1 «enum» RelationType FRIEND FAMILY COLLEAGUE FOLLOWER OTHER * invited 1 * initiated 1 Person Date lastvisit String firstname String secondname Date dateofbirth «abstract» Profile String profilename /int numberofposts /int friends * * member Group boolean isopen Date created String purpose /int headcount CD organizer 1 profilename * organized

3 Page 5 Social Network The Full Domain Model Relationship boolean pending Date requested Date accepted «enum» RelationType FRIEND FAMILY COLLEAGUE FOLLOWER OTHER * invited 1 * initiated 1 Date lastvisit String firstname String secondname Date dateofbirth int zip String city String country tagged 1 «abstract» Profile String profilename /int numberofposts /int friends 1 * InstantMessage 0..1 Person * * Group replyto Date timestamp member String content organizer 1 * 1 sent * {ordered * received * {ordered boolean isopen Date created String purpose /int members profilename Tag organized boolean confirmed * * 1 «interface» Post PhotoMessage picture 1.. * Photo double height double width Page 6 Concepts we know in CD s Classes Interfaces, abstract classes, enumerations Attributes Name + Type + Visibility derived attributes Associations Name, role names, cardinalities Composition Qualified associations Qualifier {ordered association Stereotypes like <<singleton>>

4 Page 7 We use a textual notation for CDs Text is easier to process Text is easier to define A class diagram thus becomes a text-file of this form and is stored in SocNet.cd classdiagram SocNet { CD class... class... association... We next define the textual input Page 8 Textual Form for Classes A class looks pretty similar to Java code, but no methods: classdiagram SocNet { «interface» Post interface Post; class InstantMessage implements Post { Date timestamp; String content; InstantMessage Date timestamp String content

5 Page 9 Textual Form for Enumerations An enumeration in a CD looks like this (and can be used as type elsewhere in the class diagram): Relationship class Relationship { boolean pending; Date requested; Date accepted; enum RelationType { FRIEND, FAMILY, FOLLOWER, COLLEAGUE, OTHER; boolean pending Date requested Date accepted 1 «enum» RelationType FRIEND FAMILY COLLEAGUE FOLLOWER OTHER association Relationship -> RelationType [1]; Page 10 Textual Form for Associations -1 An association in the CD: Person * * member Group association member [*] Person <-> Group [*] assoc. name navigation direction, class name multiplicity, e.g. [*], [1], [2..6], [0..1] Navigation directions: ->, <-, <-> and Assoc. name, multiplicities are optional

6 Page 11 Textual Form for Associations -2 An association in the CD: Person Group * organizer profilename * organized association [*] Person (organizer) <-> (organized) [profilename] Group [*]; role name qualifier Role names for navigation Qualifier is an attribute of the opposite class Page 12 Lets define classes: «abstract» Profile abstract class Profile { String profilename; /int numberofposts; /int friends; class Group extends Profile { boolean isopen; Date created; String purpose; /int headcount; String profilename /int numberofposts /int friends Group boolean isopen Date created String purpose /int headcount

7 Page 13 Lets define more: «interface» Post interface Post; class InstantMessage implements Post { Date timestamp; String content; 0..1 InstantMessage replyto Date timestamp String content * PhotoMessage association [*] InstantMessage <-> (replyto) InstantMessage [0..1]; class PhotoMessage extends InstantMessage; Page 14 Grammar of UML/P CD lite language Appendix CDDefinition = "classdiagram" Name "{ (CDClass CDInterface CDEnum CDAssociation)* "" CDClass = "abstract"? "class" Name ("extends" ReferenceType ("," ReferenceType)*)? ("implements" ReferenceType ("," ReferenceType)*)? (CDClassBody ";") CDClassBody = "{" CDAttribute* "" CDAttribute = "/"? Type Name ("=" Value)? ";" CDInterface = MG "interface" Name ("extends" ReferenceType ("," ReferenceType)*)? ";" CDEnum = "enum" Name (CDEnumBody* ";") CDEnumBody = "{" (CDEnumConstant ("," CDEnumConstant)* ";")? "" CDEnumConstant = Name CDQualifier = "[" Name "]" RoleName = "(" Name ")" CDAssociation = "association" "/"? Name? Cardinality? QualifiedName CDQualifier? RoleName? ( "->" "<-" "<->" "--" ) RoleName? CDQualifier? QualifiedName Cardinality? "<<ordered>>"? ";" Cardinality = "[" ("*" Int Int ".." Int Int ".." "*") "]"; This is the compact, readable grammar for the concrete syntax. For the full language spec please see:

8 Page 15 The full in textual form -1 Appendix package dex; import java.util.*; classdiagram SocNet { abstract class Profile { String profilename; /int numberofposts; /int friends; class Person extends Profile { Date lastvisit; String firstname; String secondname; Date dateofbirth; int zip; String city; String country; class Group extends Profile { boolean isopen; Date created; String purpose; /int headcount; association member [*] Person <-> Group [*]; association [1] Person (organizer) <-> (organized) [profilename] Group [*]; Excerpt from SocNet.cd Page 16 The full in textual form -2 Appendix class Relationship { boolean pending; Date requested; Date accepted; association invited [*] Relationship <-> Profile [1]; association initiated [*] Relationship <-> Profile [1]; enum RelationType { FRIEND, FAMILY, FOLLOWER, COLLEAGUE, OTHER; association Relationship -> RelationType [1]; interface Post; association received [*] Profile <-> Post [*] <<ordered>>; association sent [1] Profile <-> Post [*] <<ordered>>; class InstantMessage implements Post { Date timestamp; String content; association [*] InstantMessage <-> (replyto) InstantMessage [0..1]; class PhotoMessage extends InstantMessage; association [1..*] Photo (picture) <-> PhotoMessage; class Photo { double height; double width; class Tag { boolean confirmed; association [1] Person (tagged) <-> Tag [*]; association [*] Tag <-> Photo [1];

9 Farbe! Generative Software Engineering 2. Generating Data Explorers 2.2. How to Use DEX Prof. Dr. Bernhard Rumpe Page 18 Data Explorer (DEX) DEX is a generator for (parts of) business applications Input: Class Diagram, OCL constraints Generated result Running application for managing data fitting to the class diagram A graphical user interface Support for storing data in the cloud UML/P CD DEX generator The model: A textual class diagram DEX product: Java Swing Application

10 Page 19 DEX Product Features Frontend features CRUD (create, read, update, delete) management for objects and associations Browsing, search and filter functionality Support for Java types (e.g. List<int>, Date) Feedback on invalid input Uses dummy values for testing Backend features Database support Multiuser support Page 20 Using the DEX generator Important steps for installation 1. Install JDK Version 6 or higher 2. Set JAVA_HOME path variable to the JDK directory e.g. to C:\Programme\Java\jdk1.7.0_51 3. Download dex-cli-*-snapshot.zip from 4. Unzip it 5. Go to dex-cli 6. Run the DEX generator java -jar dex-cli-*-snapshot.jar examples/dex/socnet.cd out 7. Launch generated result: Go to out java -cp "./gen/;./gen/rte.jar" dex.socnet.socnet Sources, installation, user instructions, trouble shooting Parameters for the generator are (can be adapted): examples/dex/socnet.cd source CD out target directory for all code

11 Page 21 Lets do a DEX generator demonstration Let s modify our SocNet-example adapt the SocNet.cd file and lets make another example create or use other cd-files classdiagram MyOwnCD { class... DEX generator Farbe! Generative Software Engineering 2. Generating Data Explorers 2.3. Architecture of the Generated Product Prof. Dr. Bernhard Rumpe

12 Page 23 Structure of a generated Product This is the principal structure of the generated code: Now we have a look, how DEX builds sub-structures model Parameterized generator manually written code API generated code + included parts API Predefined Predefined Predefined components runtime system Generator script/template Environment: hardware, GUI, frameworks Map: concept code Page 24 Structure of Generated Files The generator stores all files into dex-cli/out /symtab symboltable entries (not so interesting for the moment) /gen/protocol, /gen/reporting detailed information about how dex generates files (cryptic) /gen/dex the desired java classes Java has its own package structure reflected in directories, so actually we have all classes generated from SocNet.cd in /gen/dex/socnet /gen/dex/socnet/gui /gen/dex/socnet/gui/impl /gen/dex/socnet/persistence In total we have 206 Java files (from 10 classes in SocNet) (on April 11, 2014)

13 Page 25 Architectural Pattern: 3-Tier Reference Architecture DEX structures its generated products in the same way as standard applications User interface never directly accesses (imports) persistence Persistence encapsulates access to data storage (includes DB) Application core is derived from domain data model Dimension #D1 of product structure: An appropriate architectural pattern / style The architectural pattern: SocNet (generated) package structure: GUI storage commands socnet/gui socnet/gui/impl Application Core socnet data structure Persistence socnet/persistence Page 26 Examining Generated Files for SocNet.cd Counting classes and loc: Package #classes #loc socnet socnet/gui socnet/gui/impl socnet/persistence Sum: SocNet: 10 classes, 11 associations, ~ 70 #loc Result: a lot can be generated. But how much really needs to be generated?

14 Page 27 How individual are Generated Files? -1 Experiment: take Experiment.cd with only one class XSpecific, no attributes Result Package #classes #loc /gui /gui/impl /persistence Sum: loc in total, but only 927 unique lines. XSpecific occurs 321 times in many variants (incl. comments) 19 Java filenames contain XSpecific Page 28 How individual are Generated Files? -2 Experiment 2: we compare SocNet.cd and Experiment.cd Package #classes Experiment SocNet /gui /gui/impl /persistence 7 23 Sum: Result #loc #loc SocNet 8512 unique (41837 total) Experiment 927 unique ( 2177 total) of which 630 lines are shared with SocNet and 297 individual to Experiment One filename in common (but different content)

15 Page 29 How individual are Generated Files? -3 Experiment 3: compare two sets of generated files from same source SocNet.cd Result #loc #loc SocNet 8512 unique (41837 total) of which 8507 lines are equal and 5 lines are individual Reasons for changed lines: Date and timestamp of generation process, e.g. "10:20:39 on day " // generated at 10:20:39 on day from Page 30 How much Code is Generated? Some experiments show An empty CD with zero classes has ~ 450 #loc For each additional element we get roughly ~ 1800 #loc / class ~ 150 #loc / attribute ~ 1600 #loc / *-* association, bidirectional ~ 900 #loc / 1-1 association, unidirectional Results vary, because of different forms of attributes and classes

16 Page 31 Common Code - Runtime Environment (RTE) DEX products also consist of immutable classes always in the product, independent of the domain model see: out/gen/rte.jar with currently more than 3425 classes DEX uses e.g. java.util.* etc. standard functionality (e.g. Lists) com.google.common.* useful stuff com.jidesoft.awt.* for the GUI dex.* DEX RTE mc.*, mc.umlp.cd.* MontiCore runtime and more DEX uses a DEX specific Runtime Environment (RTE) The RTE has ~195 classes, in the dex.* packages Dimension #D2 of product structure: Generated Code vs. RTE vs. Standard Components (to be extended later by handcoding) Page 32 Runtime Environment (RTE) Runtime Environment (RTE) implements the core behavior of a computer language. (Wikipedia) is a predefined set of classes assisting the generated code to fulfill its function. (own) RTE is usually defined as common, domain independent functionality used by the generated code or imported from existing libraries / frameworks Synonyms: run-time system, runtime system, or just runtime

17 Page 33 Generated Code vs. RTE vs. Standard Components According two the two dimensions #D1, #D2 the DEX product architecture thus looks like this: GUI generated RTE standard components Application Core generated RTE standard components Persistence generated RTE standard components Legend: reflect possible static knowledge (import) Specific classes may import more general classes Farbe! Generative Software Engineering 2. Generating Data Explorers 2.4. Mapping Domain Classes to Code Prof. Dr. Bernhard Rumpe

18 Page 35 Mapping of the Concepts of CD Lite The DEX generator maps each concept of CD Lite to code Classes Interfaces, abstract classes, enumerations Attributes Name + Type derived attributes Associations Name, role names, cardinalities Qualified associations Qualifier {ordered association So we need to understand how these concepts (and their variations) are mapped to code We concentrate on the application core of the product, because we will later be interested to use and extend this core Page 36 Mapping a Domain Class to what? Given class Person: What should we generate in the application core? class Person extends Profile { String firstname; // interface Person class PersonImpl factory PersonFactory for object creation manager for existing Person Instances

19 Page 37 Mapping a Domain Class to an Interface Given class Person: DEX generates an interface signature of the domain objects attributes get access functions class Person extends Profile { String firstname; // some standard functionality necessary for each domain object public interface Person Java extends dex.data.dexobject, dex.socnet.profile { public String getfirstname(); public void setfirstname(string firstname); // methods for each attribute Page 38 Mapping a Domain Class to an Implementation Each class gets a default implementation DEX generates 2 constructors, getter/setter class Person extends Profile { String firstname; // public class PersonImpl extends dex.socnet.profileimpl Java implements dex.socnet.person, dex.socnet.profile { protected PersonImpl() { super(); protected PersonImpl (String firstname, ) { this.firstname = firstname; // public String firstname ; public String getfirstname() { return firstname; public void setfirstname(string firstname) { this.firstname = firstname; //

20 Page 39 Additional Implementation elements DEX generates some additional implementations for methods from Object dex.data.dexobject class Person extends Profile { String firstname; // public class PersonImpl extends dex.socnet.profileimpl Java implements dex.socnet.person, dex.socnet.profile { // their behavior is based on all domain attributes public int compareto(dex.socnet.profile o) { public int hashcode(){ // these are used for deletion of objects public void removeobjfromassocs() { // and for representation in the GUI public String dexguigetscreenname() { Page 40 Mapping Model Inheritance to Code Inheritance and implementation relation is preserved (CD lite doesn t allow multiple inheritance, nor does DEX need it) Model-CD interface A; interface B; class C implements A; class D implements B inherits C; «interface» A «interface» C CImpl Product-CD «gen» «interface» B «interface» D DImpl

21 Page 41 Mapping a Derived Attribute A derived attribute generates getter signature no attribute, no setter empty getter implementation (the class is complete and can be instantiated) class Group extends Profile { String /headcount; // The signature is given, but the implementation is useless and needs to be added by handcoding (see Chapter 3) or by generating the implementation from OCL (see later) public class GroupImpl extends { public int getheadcount() { return 0; // nothing to support calculation or storage of headcount Java Page 42 Object Creation for a Domain Class Normally to create an object : constructor is called, thus class must be known (instead of interface) Adaptation by subclasses is then not possible. Solution: Use factory instead of constructor. DEX generates: class Person extends Profile { String firstname; // public class PersonFactory { Java // // public access through static method (Singleton) // empty default constructor public static Person create() { // finally it executes: return new PersonImpl(); // 2nd constructor with attributes as parameters (in order they appear) public static Person create(string firstname, ) {

22 Page 43 Object Management for a Domain Class Given class Person DEX generates: a PersonManager it serves as access point to load/store objects manages the collection of objects of a type (incl. subclasses) manager uses different implementations (online / demo mode) class Person extends Profile { String firstname; // public class PersonManager { Java // public static void remove(collection<person> objs) { public static void add(person obj) { public static void update(person obj) { public static void synchronize() { public static Person get(person obj) { public static void add(person obj) { public static boolean contains(person obj) { public static void clear() { Page 44 Views of a Domain Class A class in the domain model serves several viewpoints: 1) How to assess a class (for the generator user) the interface Person and the factory interface PersonFactory 2) How does it work internally (for the generator writer) the implementation PersonImpl 3) How can I adapt and extend the generated code and interface (for the product programmer) later (see Chapter 3) Decoupling into interface and implementation nicely corresponds to the first two viewpoints

23 Farbe! Generative Software Engineering 2. Generating Data Explorers 2.5. Mapping Associations to Code Prof. Dr. Bernhard Rumpe Page 46 Internals of SocNet Core - Associations Associations in CDs are realized in DEx with respect to their Cardinality e.g. 0,1,* Direction ->, --, <->, <- Modifiers abstract, / (derived) Qualifiers e.g. [qualifier], <<ordered>> Optional role and association names The core idea is to map the variants of associations to appropriate signatures and implementations The developer only needs to deal with the signatures But we also look at one or the other implementation to understand the generator and possibly adapt it.

24 Page 47 Unidirectional Association, Cardinality [1]: Unidirectional association with cardinality [1] is mapped to methods for set/get (quite like an attribute) Additional, internal signatures are created e.g. when the object is deleted, so shall be the link. association Relationship -> RelationType [1]; interface Relationship { public RelationType getrelationtype(); public void setrelationtype(relationtype o); Java Direction determines where the methods are located methods are added on the source side of each navigation Page 48 Bidirectional Associations, Role Names Bidirectional association provide methods for link management on both sides here is the direction <- and the role name given: association [1] Person (tagged) <-> Tag [*]; interface Tag { public Person gettagged(); public void settagged(person o); Java + methods for class Person for other direction

25 Page 49 Association, Cardinality [*]: Association with cardinality [*] is mapped to methods for collection management (quite like the Set<X> signature) association [1] Person (tagged) <-> Tag [*]; interface Person { public boolean containsalltags(collection<tag> o); public boolean containstag(tag o); public boolean isemptytags(); public Iterator<Tag> iteratortags(); public int sizetags(); public boolean addtag(tag o); public void cleartags(); public boolean removetag(tag o); Java Page 50 Implementation of Associations Implementation depends on cardinality: [1], [0..1] map to an ordinary attribute [*], [1..*], [2..7] etc. map to a collection association [1] Person (tagged) <-> Tag [*]; public class PersonImpl implements Person { private java.util.set<tag> tags = new java.util.hashset<tag>(); // Tag-methods delegate functionality to Set, e.g. public boolean containstag(tag o) { return tags.contains(o); public class TagImpl implements Tag { private Person tagged; // + getter/setter Redundant storage of links on both sides! Consistency needs to be ensured Java Java

26 Page 51 Consistency in Bidirectional Associations We need to ensure that links are consistent on both sides adding a link automatically adds the link on the other object association [1] Person (tagged) <-> Tag [*]; DEX generates additionaly xgenxaddtag, xgenxremovetag xgenx-methods are assessed from outside: thus public, but should not be used by the developer: thus unusual name public class PersonImpl { public boolean xgenxaddtag(tag o) { return tags.add(o); public boolean xgenxremovetag(tag o) { return tags.remove(o); public boolean addtag(tag o) { o.xgenxsettagged(this); return tags.add(o); Java Called from opposite side of link to make Bidirectional consistent Calling the opposite link Page 52 Unspecified Cardinality on Associations In case a cardinality isn t given, defaults are taken: navigable side is assumed to be [0..1] not navigable side is assumed to be [*] Thus: A -> B [*] A -> B [0..1], A <-> B [0..1] A <-> B [0..1], A -- B [0..1] A -- B [0..1] default:bidirectional Please note: not navigable direction still store references in opposite directions for consistency reasons, e.g. in case when target objects are deleted (exception enums)

27 Page 53 Deleting linked Objects Two realizations of the same structure: class Tag { Photo photo; CD association [*] Tag -> Photo [1]; As discussed: for consistency DEX generates additional xgenxmethods for the association and handle the associations as bidirectional DEX does that also for attributes, because when user deletes a Photo-object DEX also removes the links in all places where the object was referenced Decision for DEX: Deletion is always possible and null is a possible value in attributes as well as [1]-associations to classes (other than enums) defined in the CD. Page 54 Derived Association a derived association means (in analogy to a derived attribute): only retrieval functionality is provided in the interface, but with emtpy / useless implementation in the Impl-class this is to be handcoded (Chap. 3) association / member [*] Person <-> Group [*]; CD no manipulation methods association name Java interface Person { public boolean containsallmembers(collection<group> o); public boolean containsmember(group o); public boolean isemptymembers(); public Iterator<Group> iteratormembers(); public int sizemembers();

28 Page 55 Qualified Association a qualified association has same methods as unqualified assoc. plus methods from Map<X,Y> signature association [1] Person (organizer) <-> (organized) [profilename] Group [*]; target type key = attribute of type String interface Group { // boolean containsorganizer(person o); boolean containsorganizer(string key); role name boolean isemptyorganizers(); java.util.iterator<person> iteratororganizers(); int sizeorganizers(); java.util.set<string> keysetorganizer(); java.util.collection<person> valuesorganizer(); Person getorganizer(string key); void addorganizer(person o); void putorganizer(string key, Person o); void clearorganizers(); void removeorganizer(person o); Java Page 56 Ordered Association An <<ordered>> association provides List<X>-like signature More than 20 methods, here an excerpt: association sent [1] Profile <-> Post [*] <<ordered>> interface Profile { // boolean containssent(post o); boolean isemptysents(); int sizesents(); boolean addsent(post o); void addsent(int index, Post o); Post getsent(int index); int indexofsent(post o); int lastindexofsent(post o); void clearsents(); boolean removesent(post o); boolean removesent(int index); void setsent(int index, Post o); Java

29 Page 57 Ordered Association 2 More functionality: association sent [1] Profile <-> Post [*] <<ordered>> interface Profile { // boolean containsallsents(java.util.collection<post> o); Java Iterator<Post> iteratorsents(); ListIterator<Post> listiteratorsents(); ListIterator<Post> listiteratorsents(int index); boolean addallsent(collection<? extends Post> o); boolean addallsent(int index, Collection<? extends Post> o); boolean removeallsent(collection<post> o); List<Post> sublistsent(int start, int end); Page 58 Summary Associations This is the implementation and provided signatures: [1]-assoc. attribute + get/set [*]-assoc Set<X> + Set methods <<ordered>> List<X> + List methods qualified Map<qualifier,X> + Map methods DEX chooses to implement always bidirectional Consistency of bidirectional assocs is guaranteed Cardinality constraints are not guaranteed because DEX currently does not know how to handle violations DEX also provides search functions for [*] assocs

30 Page 59 Summary Lessons learned How to write class diagrams in CD lite How the DEX generator is started What DEX generates The architecture of the product Runtime environment vs. generated code How DEX maps classes and associations to code In particular we have seen: translation of associations has many facets the ratio output #loc / input #loc hints towards a tremendous speedup in generative software development

Compositional Model Based Software Development

Compositional Model Based Software Development Compositional Model Based Software Development Prof. Dr. Bernhard Rumpe http://www.se-rwth.de/ Seite 2 Our Working Groups and Topics Automotive / Robotics Autonomous driving Functional architecture Variability

More information

CD2Alloy: A Translation of Class Diagrams to Alloy. and Back from Alloy Instances to Object Diagrams

CD2Alloy: A Translation of Class Diagrams to Alloy. and Back from Alloy Instances to Object Diagrams Aachen Department of Computer Science Technical Report CD2Alloy: A Translation of Class Diagrams to Alloy and Back from Alloy Instances to Object Diagrams Oliver Kautz, Shahar Maoz, Jan Oliver Ringert,

More information

SUMMARY: MODEL DRIVEN SECURITY

SUMMARY: MODEL DRIVEN SECURITY SUMMARY: MODEL DRIVEN SECURITY JAN-FILIP ZAGALAK, JZAGALAK@STUDENT.ETHZ.CH Model Driven Security: From UML Models to Access Control Infrastructres David Basin, Juergen Doser, ETH Zuerich Torsten lodderstedt,

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models CS 494 Object-Oriented Analysis & Design UML Class Models Overview How class models are used? Perspectives Classes: attributes and operations Associations Multiplicity Generalization and Inheritance Aggregation

More information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information

Cloning Enums. Cloning and Enums BIU OOP

Cloning Enums. Cloning and Enums BIU OOP Table of contents 1 Cloning 2 Integer representation Object representation Java Enum Cloning Objective We have an object and we need to make a copy of it. We need to choose if we want a shallow copy or

More information

EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

EJB 3 Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule Berner Fachhochschule Technik und Informatik EJB 3 Entities Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content Characteristics of entities Programming

More information

Top Down Design vs. Modularization

Top Down Design vs. Modularization 6.170 Quiz Review Topics: 1. Decoupling 2. 3. AF & RI 4. Iteration Abstraction & Iterators 5. OMs and Invariants 6. Equality, Copying, Views 7. 8. Design Patterns 9. Subtyping 10. Case Studies Decomposition

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information

Generating/Updating code from whole project

Generating/Updating code from whole project Round-trip engineering is the ability to generate model from source code and generate source code from UML model, and keep them synchronized. You can make use of round-trip engineering to keep your implementation

More information

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented Table of Contents L01 - Introduction L02 - Strings Some Examples Reserved Characters Operations Immutability Equality Wrappers and Primitives Boxing/Unboxing Boxing Unboxing Formatting L03 - Input and

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #13: Java OO cont d. Janak J Parekh janak@cs.columbia.edu Administrivia Homework due next week Problem #2 revisited Constructors, revisited Remember: a

More information

CSCE 156 Computer Science II

CSCE 156 Computer Science II CSCE 156 Computer Science II Lab 04 - Classes & Constructors Dr. Chris Bourke Prior to Lab 1. Review this laboratory handout prior to lab. 2. Read Object Creation tutorial: http://download.oracle.com/javase/tutorial/java/javaoo/objectcreation.

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 02: Using Objects MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Using Objects 2 Introduction to Object Oriented Programming Paradigm Objects and References Memory Management

More information

JPA Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule

JPA Entities. Course Multi Tier Business Applications with Java EE. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel. Berner Fachhochschule Berner Fachhochschule Technik und Informatik JPA Entities Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content Characteristics of entities Programming

More information

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools UML Modeling I Instructor: Yongjie Zheng September 3, 2015 CS 490MT/5555 Software Methods and Tools Object-Oriented Design: Topics & Skills Rational Unified Process Unified Modeling Languages (UML) Provide

More information

Java Persistence API (JPA) Entities

Java Persistence API (JPA) Entities Java Persistence API (JPA) Entities JPA Entities JPA Entity is simple (POJO) Java class satisfying requirements of JavaBeans specification Setters and getters must conform to strict form Every entity must

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107 A abbreviations 17 abstract class 105 abstract data types 105 abstract method 105 abstract types 105 abstraction 92, 105 access level 37 package 114 private 115 protected 115 public 115 accessors 24, 105

More information

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE

PART 1. Eclipse IDE Tutorial. 1. What is Eclipse? Eclipse Java IDE PART 1 Eclipse IDE Tutorial Eclipse Java IDE This tutorial describes the usage of Eclipse as a Java IDE. It describes the installation of Eclipse, the creation of Java programs and tips for using Eclipse.

More information

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

Object-oriented basics. Object Class vs object Inheritance Overloading Interface Object-oriented basics Object Class vs object Inheritance Overloading Interface 1 The object concept Object Encapsulation abstraction Entity with state and behaviour state -> variables behaviour -> methods

More information

MontiCore A Framework for DSL-Development

MontiCore A Framework for DSL-Development MontiCore A Framework for DSL-Development Efficient Editor Generation for Compositional DSLs in Eclipse Holger Krahn, Bernhard Rumpe, Steven Völkel Software Systems Technische Universität Braunschweig

More information

CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects

CmSc 150 Fundamentals of Computing I. Lesson 28: Introduction to Classes and Objects in Java. 1. Classes and Objects CmSc 150 Fundamentals of Computing I Lesson 28: Introduction to Classes and Objects in Java 1. Classes and Objects True object-oriented programming is based on defining classes that represent objects with

More information

Enums. In this article from my free Java 8 course, I will talk about the enum. Enums are constant values that can never be changed.

Enums. In this article from my free Java 8 course, I will talk about the enum. Enums are constant values that can never be changed. Enums Introduction In this article from my free Java 8 course, I will talk about the enum. Enums are constant values that can never be changed. The Final Tag To display why this is useful, I m going to

More information

Tutorial 02: Writing Source Code

Tutorial 02: Writing Source Code Tutorial 02: Writing Source Code Contents: 1. Generating a constructor. 2. Generating getters and setters. 3. Renaming a method. 4. Extracting a superclass. 5. Using other refactor menu items. 6. Using

More information

Classes, interfaces, & documentation. Review of basic building blocks

Classes, interfaces, & documentation. Review of basic building blocks Classes, interfaces, & documentation Review of basic building blocks Objects Data structures literally, storage containers for data constitute object knowledge or state Operations an object can perform

More information

Object-Relational Mapping

Object-Relational Mapping Object-Relational Mapping Object-Relational Mapping Software Architecture ORM Problems ORM Solutions Demo Software Architecture Part 1 Architecture Separation of Concerns A design principle that comprises

More information

Java Fundamentals (II)

Java Fundamentals (II) Chair of Software Engineering Languages in Depth Series: Java Programming Prof. Dr. Bertrand Meyer Java Fundamentals (II) Marco Piccioni static imports Introduced in 5.0 Imported static members of a class

More information

Subclassing for ADTs Implementation

Subclassing for ADTs Implementation Object-Oriented Design Lecture 8 CS 3500 Fall 2009 (Pucella) Tuesday, Oct 6, 2009 Subclassing for ADTs Implementation An interesting use of subclassing is to implement some forms of ADTs more cleanly,

More information

Java Programming. Manuel Oriol, March 22nd, 2007

Java Programming. Manuel Oriol, March 22nd, 2007 Java Programming Manuel Oriol, March 22nd, 2007 Goal Teach Java to proficient programmers 2 Roadmap Java Basics Eclipse Java GUI Threads and synchronization Class loading and reflection Java Virtual Machines

More information

Section 9: Design Patterns. Slides adapted from Alex Mariakakis, with material from David Mailhot, Hal Perkins, Mike Ernst

Section 9: Design Patterns. Slides adapted from Alex Mariakakis, with material from David Mailhot, Hal Perkins, Mike Ernst Section 9: Design Patterns Slides adapted from Alex Mariakakis, with material from David Mailhot, Hal Perkins, Mike Ernst Agenda What are design patterns? Creational patterns review Structural patterns

More information

Page 1

Page 1 Java 1. Core java a. Core Java Programming Introduction of Java Introduction to Java; features of Java Comparison with C and C++ Download and install JDK/JRE (Environment variables set up) The JDK Directory

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview Introduction to Visual Basic and Visual C++ Introduction to Java Lesson 13 Overview I154-1-A A @ Peter Lo 2010 1 I154-1-A A @ Peter Lo 2010 2 Overview JDK Editions Before you can write and run the simple

More information

Self-review Questions

Self-review Questions 7Class Relationships 106 Chapter 7: Class Relationships Self-review Questions 7.1 How is association between classes implemented? An association between two classes is realized as a link between instance

More information

The Strategy Pattern Design Principle: Design Principle: Design Principle:

The Strategy Pattern Design Principle: Design Principle: Design Principle: Strategy Pattern The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. Design

More information

EJB 3 Entity Relationships

EJB 3 Entity Relationships Berner Fachhochschule Technik und Informatik EJB 3 Entity Relationships Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content What are relationships?

More information

The Design Patterns Matrix From Analysis to Implementation

The Design Patterns Matrix From Analysis to Implementation The Design Patterns Matrix From Analysis to Implementation This is an excerpt from Shalloway, Alan and James R. Trott. Design Patterns Explained: A New Perspective for Object-Oriented Design. Addison-Wesley

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 31 Static Members Welcome to Module 16 of Programming in C++.

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

CSCE3193: Programming Paradigms

CSCE3193: Programming Paradigms CSCE3193: Programming Paradigms Nilanjan Banerjee University of Arkansas Fayetteville, AR nilanb@uark.edu http://www.csce.uark.edu/~nilanb/3193/s10/ Programming Paradigms 1 Java Packages Application programmer

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

Aggregation. Introduction to Computer Science I. Overview (1): Overview (2): CSE 1020 Summer Bill Kapralos. Bill Kapralos.

Aggregation. Introduction to Computer Science I. Overview (1): Overview (2): CSE 1020 Summer Bill Kapralos. Bill Kapralos. Aggregation Thursday, July 6 2006 CSE 1020, Summer 2006, Overview (1): Before We Begin Some administrative details Some questions to consider Aggregation Overview / Introduction The aggregate s constructor

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Introduction IS

Introduction IS Introduction IS 313 4.1.2003 Outline Goals of the course Course organization Java command line Object-oriented programming File I/O Business Application Development Business process analysis Systems analysis

More information

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.)

Design Pattern. CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) Design Pattern CMPSC 487 Lecture 10 Topics: Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, et al.) A. Design Pattern Design patterns represent the best practices used by experienced

More information

EJB 3 Entity Relationships

EJB 3 Entity Relationships Berner Fachhochschule Technik und Informatik EJB 3 Entity Relationships Course Multi Tier Business Applications with Java EE Prof. Dr. Eric Dubuis Berner Fachhochschule Biel Content What are relationships?

More information

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 6: CREATIONAL DESIGN PATTERNS CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION III: BUILDER, PROTOTYPE, SINGLETON Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero For non-profit

More information

2. The object-oriented paradigm

2. The object-oriented paradigm 2. The object-oriented paradigm Plan for this section: Look at things we have to be able to do with a programming language Look at Java and how it is done there Note: I will make a lot of use of the fact

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM

CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM CS 315 Software Design Homework 3 Preconditions, Postconditions, Invariants Due: Sept. 29, 11:30 PM Objectives Defining a wellformed method to check class invariants Using assert statements to check preconditions,

More information

Programming Kotlin. Familiarize yourself with all of Kotlin s features with this in-depth guide. Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI

Programming Kotlin. Familiarize yourself with all of Kotlin s features with this in-depth guide. Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI Programming Kotlin Familiarize yourself with all of Kotlin s features with this in-depth guide Stephen Samuel Stefan Bocutiu BIRMINGHAM - MUMBAI Programming Kotlin Copyright 2017 Packt Publishing First

More information

JAVA MOCK TEST JAVA MOCK TEST II

JAVA MOCK TEST JAVA MOCK TEST II http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

COMP 250 Winter 2011 Reading: Java background January 5, 2011

COMP 250 Winter 2011 Reading: Java background January 5, 2011 Almost all of you have taken COMP 202 or equivalent, so I am assuming that you are familiar with the basic techniques and definitions of Java covered in that course. Those of you who have not taken a COMP

More information

Chapter 10 Object-Oriented Design Principles

Chapter 10 Object-Oriented Design Principles Chapter 10 Object-Oriented Design Principles Dr. Supakit Nootyaskool Faculty of Information Technology King Mongkut s Institute of Technology Ladkrabang Outline Object-oriented design: bridging from analysis

More information

A4 Explain how the Visitor design pattern works (4 marks)

A4 Explain how the Visitor design pattern works (4 marks) COMP61532 exam Performance feedback Original marking scheme in bold, additional comments in bold italic. Section A In general the level of English was poor, spelling and grammar was a problem in most cases.

More information

Java: advanced object-oriented features

Java: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Packages

More information

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline Java Intro 3 9/7/2007 1 Java Intro 3 Outline Java API Packages Access Rules, Class Visibility Strings as Objects Wrapper classes Static Attributes & Methods Hello World details 9/7/2007 2 Class Libraries

More information

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM

CS 215 Software Design Homework 3 Due: February 28, 11:30 PM CS 215 Software Design Homework 3 Due: February 28, 11:30 PM Objectives Specifying and checking class invariants Writing an abstract class Writing an immutable class Background Polynomials are a common

More information

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar

Java Classes. Produced by. Introduction to the Java Programming Language. Eamonn de Leastar Java Classes Introduction to the Java Programming Language Produced by Eamonn de Leastar edeleastar@wit.ie Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists

Regis University CC&IS CS310 Data Structures Programming Assignment 2: Arrays and ArrayLists Regis University CC&IS CS310 Data Structures Programming Assignment 2 Arrays and ArrayLists Problem Scenario The real estate office was very impressed with your work from last week. The IT director now

More information

CSE 341, Autumn 2015, Ruby Introduction Summary

CSE 341, Autumn 2015, Ruby Introduction Summary CSE 341, Autumn 2015, Ruby Introduction Summary Disclaimer: This lecture summary is not necessarily a complete substitute for atting class, reading the associated code, etc. It is designed to be a useful

More information

What is it? CMSC 433 Programming Language Technologies and Paradigms Spring Approach 1. Disadvantage of Approach 1

What is it? CMSC 433 Programming Language Technologies and Paradigms Spring Approach 1. Disadvantage of Approach 1 CMSC 433 Programming Language Technologies and Paradigms Spring 2007 Singleton Pattern Mar. 13, 2007 What is it? If you need to make sure that there can be one and only one instance of a class. For example,

More information

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics Inf1-OOP OOP Exam Review Perdita Stevens, adapting earlier version by Ewan Klein School of Informatics March 16, 2015 Overview Overview of examinable material: Lectures Topics S&W sections Week 1 Compilation,

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Configuration Provider: A Pattern for Configuring Threaded Applications

Configuration Provider: A Pattern for Configuring Threaded Applications Configuration Provider: A Pattern for Configuring Threaded Applications Klaus Meffert 1 and Ilka Philippow 2 Technical University Ilmenau plop@klaus-meffert.de 1, ilka.philippow@tu-ilmena.de 2 Abstract

More information

Procedural Abstraction

Procedural Abstraction Procedural Abstraction Comp-303 : Programming Techniques Lecture 5 Alexandre Denault Computer Science McGill University Winter 2004 February 16, 2004 Lecture 5 Comp 303 : Programming Techniques Page 1

More information

Topic 7: Algebraic Data Types

Topic 7: Algebraic Data Types Topic 7: Algebraic Data Types 1 Recommended Exercises and Readings From Haskell: The craft of functional programming (3 rd Ed.) Exercises: 5.5, 5.7, 5.8, 5.10, 5.11, 5.12, 5.14 14.4, 14.5, 14.6 14.9, 14.11,

More information

Chapter 4: Writing Classes

Chapter 4: Writing Classes Chapter 4: Writing Classes Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Writing Classes We've been using predefined classes. Now we will learn to write our own

More information

More C++ : Vectors, Classes, Inheritance, Templates. with content from cplusplus.com, codeguru.com

More C++ : Vectors, Classes, Inheritance, Templates. with content from cplusplus.com, codeguru.com More C++ : Vectors, Classes, Inheritance, Templates with content from cplusplus.com, codeguru.com 2 Vectors vectors in C++ basically arrays with enhancements indexed similarly contiguous memory some changes

More information

Applying Code Generation Approach in Fabrique Kirill Kalishev, JetBrains

Applying Code Generation Approach in Fabrique Kirill Kalishev, JetBrains november 2004 Applying Code Generation Approach in Fabrique This paper discusses ideas on applying the code generation approach to help the developer to focus on high-level models rather than on routine

More information

TradeInterceptor SDK Quick Start Guide

TradeInterceptor SDK Quick Start Guide TradeInterceptor SDK Quick Start Guide Installation Custom indicators and trading strategies can be created using the Java programming language, version 6.0. A free copy of Java development kit (JDK) can

More information

Software Design COSC 4353/6353 D R. R A J S I N G H

Software Design COSC 4353/6353 D R. R A J S I N G H Software Design COSC 4353/6353 D R. R A J S I N G H Creational Design Patterns What are creational design patterns? Types Examples Structure Effects Creational Patterns Design patterns that deal with object

More information

An Introduction to Patterns

An Introduction to Patterns An Introduction to Patterns Robert B. France Colorado State University Robert B. France 1 What is a Pattern? - 1 Work on software development patterns stemmed from work on patterns from building architecture

More information

The New C Standard (Excerpted material)

The New C Standard (Excerpted material) The New C Standard (Excerpted material) An Economic and Cultural Derek M. Jones derek@knosof.co.uk Copyright 2002-2008 Derek M. Jones. All rights reserved. 1378 type specifier type-specifier: void char

More information

2.1 Design Patterns and Architecture (continued)

2.1 Design Patterns and Architecture (continued) MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Timed Automata

More information

Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9 Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013 2 Things to Review Review the Class Slides: Key Things to Take Away Do you understand

More information

Java SE7 Fundamentals

Java SE7 Fundamentals Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various

More information

2.1 Design Patterns and Architecture (continued)

2.1 Design Patterns and Architecture (continued) MBSE - 2.1 Design Patterns and Architecture 1 2.1 Design Patterns and Architecture (continued) 1. Introduction 2. Model Construction 2.1 Design Patterns and Architecture 2.2 State Machines 2.3 Abstract

More information

C#: advanced object-oriented features

C#: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer C#: advanced object-oriented features Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Namespaces

More information

Metamodeling with Metamodels. Using. UML/MOF including OCL

Metamodeling with Metamodels. Using. UML/MOF including OCL Metamodeling with Metamodels Using UML/MOF including OCL Introducing Metamodels (Wikipedia) A metamodel is a model of a model An instantiation of metamodel gives a model Metamodeling is the process of

More information

News in RSA-RTE CP1

News in RSA-RTE CP1 IBM Software Group News in RSA-RTE 8.5.1 CP1 Mattias Mohlin, April 2013 2013 IBM Corporation Build A C++ External Library TC can now generate the make file to use for building the library from a CDT project

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. Object Oriented Programming

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. Object Oriented Programming BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT Object Oriented Programming Examiner s Report March 2017 A1. a) Explain what is meant by the following terms:

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

Design Pattern and Software Architecture: IV. Design Pattern

Design Pattern and Software Architecture: IV. Design Pattern Design Pattern and Software Architecture: IV. Design Pattern AG Softwaretechnik Raum E 3.165 Tele.. 60-3321 hg@upb.de IV. Design Pattern IV.1 Introduction IV.2 Example: WYSIWYG Editor Lexi IV.3 Creational

More information

[ANALYSIS ASSIGNMENT 10]

[ANALYSIS ASSIGNMENT 10] 2009 Pidgin Carlos Simões Higino Silva João Carlos Almeida Miguel Graça Oliveira [ANALYSIS ASSIGNMENT 10] INTRODUCTION The purpose of this project is to evaluate a testing tool chosen by the team and provide

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Interfaces. An interface forms a contract between the object and the outside world.

Interfaces. An interface forms a contract between the object and the outside world. Interfaces An interface forms a contract between the object and the outside world. For example, the buttons on the television set are the interface between you and the electrical wiring on the other side

More information

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism.

Outline. Inheritance. Abstract Classes Interfaces. Class Extension Overriding Methods Inheritance and Constructors Polymorphism. Outline Inheritance Class Extension Overriding Methods Inheritance and Constructors Polymorphism Abstract Classes Interfaces 1 OOP Principles Encapsulation Methods and data are combined in classes Not

More information

Interfaces (1/2) An interface forms a contract between the object and the outside world.

Interfaces (1/2) An interface forms a contract between the object and the outside world. Interfaces (1/2) An interface forms a contract between the object and the outside world. For example, the buttons on remote controls for some machine. As you can see, an interface is a reference type,

More information

Lightweight J2EE Framework

Lightweight J2EE Framework Lightweight J2EE Framework Struts, spring, hibernate Software System Design Zhu Hongjun Session 4: Hibernate DAO Refresher in Enterprise Application Architectures Traditional Persistence and Hibernate

More information

Chapter 4 Java Language Fundamentals

Chapter 4 Java Language Fundamentals Chapter 4 Java Language Fundamentals Develop code that declares classes, interfaces, and enums, and includes the appropriate use of package and import statements Explain the effect of modifiers Given an

More information

Programming by Delegation

Programming by Delegation Chapter 2 a Programming by Delegation I. Scott MacKenzie a These slides are mostly based on the course text: Java by abstraction: A client-view approach (4 th edition), H. Roumani (2015). 1 Topics What

More information

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance Contents Topic 04 - Inheritance I. Classes, Superclasses, and Subclasses - Inheritance Hierarchies Controlling Access to Members (public, no modifier, private, protected) Calling constructors of superclass

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 02: Using Objects MOUNA KACEM mouna@cs.wisc.edu Spring 2018 Using Objects 2 Introduction to Object Oriented Programming Paradigm Objects and References Memory Management

More information

D Programming Language

D Programming Language Group 14 Muazam Ali Anil Ozdemir D Programming Language Introduction and Why D? It doesn t come with a religion this is written somewhere along the overview of D programming language. If you actually take

More information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming Objectives To review the concepts and terminology of object-oriented programming To discuss some features of objectoriented design 1-2 Review: Objects In Java and other Object-Oriented

More information