COSC6442 – Object Oriented Software Construction - York University

5 downloads 24 Views 545KB Size Report
Object Oriented Software Construction 30/12/2004 10:57 PM. 0. Department of Computer Science, York University. COSC6442 – Object Oriented Software.
COSC6442 – Object Oriented Software Construction Core Concepts and Tools

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

0

Note ƒ See 3311 course website ƒ Initial slides the same

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

1

Core Concepts (1) ƒ Core OO technologies o o o o o o o

classes vs. objects Clusters Polymorphism Genericity multiple inheritance Contracts (specification vs. implementation) tuples and agents

ƒ Plan-driven vs. Test-Driven Development (TDD) ƒ Design By Contract (DbC)

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

2

Core Concepts (2) ƒ Design Patterns ƒ Architectural Diagrams (BON) ƒ Tools o Estudio: Integrated Development Environments (including Debuggers and Documentation Tools) o ETest: Testing Tools

ƒ An adequately documented relatively large project

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

3

Advanced Topics ƒ Simple Concurrent Object Oriented Programming (SCOOP) ƒ Event Driven Programming and Statecharts ƒ Model Driven Development ƒ Formal Methods

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

4

Tentative Grading ƒ ƒ

ƒ ƒ

15% - Assignment 1 [due January 27th]. [Team of up to 2] 10% - Write a (max. 10 page) MDD or Metamodelling tutorial with one complete motivating problem [Individual] 10% - Do a 10 minute presentation of your paper or your project after reading week [Individual] 65% - FIT project in Eiffel [Team] o 25% - phase 1 after reading week o 40% - phase 2 at end of term

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

5

Tools: ec55, Estudio and ETest ƒ Prism (Linux): o Write a "Hello World" program in the York CSE Prism Lab (Linux) using the command line compiler (ec55) and clean out your directories (eclean) o Use the Estudio IDE and ETest GUI to write a unit test, compile it, and run the test. o Learn how to use the debugger

ƒ For your home computer: o Download the free version of EiffelStudio V5.5 from www.eiffel.com. o Install Etest.

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

6

Tutorials ƒ Invitation to Eiffel ƒ EiffelStudio: A Guided Tour ƒ Macromedia Flash introductions to various Eiffel topics.

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

7

Command Line Compiler ƒ Need a Root Class with a creation feature: root_class.e ƒ Need and Ace file: hello_world.ace ƒ Command line compiler ec55

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

8

An Eiffel Class – root_class.e class ROOT_CLASS create make feature make is -- Print Hello World do print ("Hello World") end end

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

9

Ace File – hello_world.ace system "hello_world" root ROOT_CLASS: make cluster -- Hello World Application root_cluster: ". " -- BASE library base: "$ISE_EIFFEL/library/base" exclude "table_eiffel3"; "desc"; end end Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

10

Command line compiler – ec55 ƒ

red% ec55 -ace hello_world.ace -c_compile Eiffel compilation manager [ 0% - 2] Degree 6 cluster root_cluster [ 5% - 20] Degree 6 cluster base [ 10% - 19] Degree 6 cluster base.event [ 15% - 18] Degree 6 cluster base.kernel [ 20% - 17] Degree 6 cluster base.kernel.classic ... C compilation completed

ƒ

red% cd EIFGEN/W_code/ red% ls C1/ C3/ C5/ C7/ E1/ Makefile.SH config.sh hello_world.melted C2/ C4/ C6/ C8/ Makefile TRANSLAT hello_world*

ƒ

red% ./hello_world Hello World

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

11

Directory Structure (Hello World) Root cluster

root cluster

base cluster

files Ace.ace root_class.e

directory (cluster)

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

12

Bigger Projects Root cluster

cluster Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

13

Interactive Development Environment ƒ Within a single GUI called Estudio o o o o o o o o

Automatically generate Ace file Edit code Compile code Run program Debug program BON architectural diagrams Automatically generate documentation Metrics

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

14

Initial estudio window Select a button For create a new project, press NEXT, and see next slides. For open existing Ace file, press NEXT, and follow Instructions. For open compiled project select epr file, then press OK.

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

15

Notes ƒ DO NOT use o estudio55 & o sysin and sysout will not work with estudio in the background

ƒ Each instance of estudio55 can only work with one system (project) at a time. o To run two or more systems simultaneously requires starting an instance of estudio55 for each system.

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

16

Eiffel on Prism ƒ Use ACE files to describe o the files comprising your system o how to execute it o examples in Eiffel directory /cs/local/packages/Eiffel55/examples

ƒ Compilation vs finalizing ƒ Other Eiffel compilers o SmallEiffel (free!) o Visual Eiffel o Free ISE Eiffel – sufficient for the course www.eiffel.com

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

17

Initial project settings

Edit fields for your system

COMPILE or DO NOT COMPILE AT THIS TIME

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

18

Modify project settings

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

19

Set precompile library & assertion check Can add clusters from this sub-window

Select all assertions Select library base+time+etest Press OK

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

20

Useful buttons Run the program

Run in debug mode

Create a new class

Compile your program

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

21

ETest ƒ On Prism: etest& ƒ Compile via Estudio so as to produce an executable ƒ Select EIFGEN/W_code/executable ƒ Press Run Test

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

22

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

23

ETest ƒ Runs tests automatically and displays them o Green bar o Red bar

ƒ Archive your code ƒ Eclean your code ƒ Small editing changes and recompilation

Department of Computer Science, York University

Object Oriented Software Construction

30/12/2004 10:57 PM

24

Suggest Documents