SFT2021/SFT3021

OBJECT ORIENTED PROGRAMMING SYSTEMS

 

SUBJECT - WEEK BY WEEK

 

SEMESTER 1

 

1998

 

CONTENTS

Syllabus

 

Assessment

 

Venue and Class Schedule

 

Lecture Outline

 

Laboratory Sessions

 

Bank Exercise

 

Assignment

 

 

 

MONASH UNIVERSITY _

 

FACULTY OF COMPUTING AND INFORMATION TECHNOLOGY

 

School of Computer Science & Software Engineering

 

COURSE: BACHELOR OF COMPUTING (INFORMATION SYSTEMS)

 

SUBJECT: SFT2021/SFT3021 - OBJECT ORIENTED PROGRAMMING SYSTEMS

SEMESTER 1 1998

INTRODUCTION

 

The subject SFT2021/SFT3021 consists of a 13 week unit on Object Oriented Design and Programming. SFT2021 is a 4 point unit and SFT3021 is a 6 point unit.

Lecturer:

Sita Ramakrishnan (Caulfield Day): Room C5.09 Phone: 99032702

SYLLABUS CONTENT FOR SFT2021/3021

 

Objectives: At the completion of the Object Oriented Programming Systems unit the student should have: an understanding of the Object-Oriented (O-O) paradigm, the ability to explore the concepts and facilities provided by O-O programming languages such as Eiffel and Java; a knowledge of an incremental scenario based approach to achieve both process and product quality improvements in O-O software development in a reuse context. The students will use Eiffel as the implementation language.

 

Recommended TextBooks:

 

1. THOMAS and WEEDON (1995) Object-Oriented Programming in Eiffel, Addison-Wesley

or WIENER (1995) Software Development Using Eiffel, Prentice-Hall

2. LARMAN (1998) Applying UML and Patterns: An Introduction to OO Analysis & Design, Prentice-Hall

or FOWLER Martin (1997) UML Distilled: Applying the standard object modeling language, Addison-Wesley

 

References:

MEYER (1997) Object-oriented Software Construction, 2nd ed., Prentice-Hall

MEYER (1994) Reusable Software, Prentice-Hall

WALDEN and NERSON (1995) Seamless Object-Oriented Software Architecture, Prentice-Hall

MEYER (1991) Eiffel, The Language, Prentice-Hall

SALLIS P, TATE G and MacDonell S (1995) Software Engineering: Practice, Management, Improvement, Addison-Wesley

GILB T and GRAHAM D (1993) Software Inspection, Addison-Wesley

SWITZER (1993) Eiffel - An Introduction, Prentice-Hall

RUMBAUGH (1991) Object Oriented Modeling and Design, Prentice-Hall

JEZEQUEL (1996) Object-Oriented Software Engineering with Eiffel, Addison-Wesley

YOURDON (1996) Case Studies in Object-oriented Analysis and Design, Prentice-Hall

ELIENS A (1995) Principles of Object-Oriented Software Development, Addison-Wesley

EMBLEY D W, KURTZ B D and WOODFIELD S N (1992) Object-Oriented Systems Analysis, A Model-driven Approach, Yourdon Press, Prentice-Hall

GOLDBERG A and RUBIN K (1995) Succeeding with Objects, Addison-Wesley.

STRAUSS S H and EBENAU R G (1994) Software Inspection Process, McGraw Hill

 

Assessment

Assessment of practical tutorial exercises 10%

Assignment 40%

Grading of the above based on progressive assessment and students

are required to submit/present/demonstrate/able to answer questions on their individual and group work on an ongoing basis as part of tute assessment requirements. Failing to do so will affect their marks.

Unit test during Lecture 10%

Formal examination 40%

-----------------

100%

 

Students will work on their own for the bank exercise and for the assignment in groups of three. However each student must be familiar with all aspects of the practical work in order to expect to perform adequately in the test and formal examination.

 

NOTE:

 

SFT2021 students are not required to do scenario 2 of assignment, but must make sure that they have taken an appropriate slice of the system in scenario 1 as spelt out by the lecturer through the tutors. Their final marks for the exercises and assignment will be adjusted up so that the tutorial assessment component is still worth 50%

 

Venue and Class Schedule for Sem.1 1998

 

Lecture room: A2.11 Tues 6 - 8 pm

Normal Tute times: NT lab F5.20, 12 - 2pm Monday and NT lab & K1.03 8-10pm Tuesdays

The class commences on March 3rd 1998.

Mid sem. Break for Easter after 6 weeks of classes - 10th April -17th April 98

Classes recommence 21st April 98(week 7)

Unit Test for sft2021/3021 in the lecture room at 6pm, May 26th 1998

 

Sem1 1998 ends Friday 5th June 98

Exam Period for sem1 98 - 8th June - 3rd July 98

Sem.2 1998 commences on July 20th 1998

 

 

 

 

 

Lecture Outline:

 

Week 1 Object Oriented Concepts, terminology

Basic elements of Eiffel Programming

Week 2 Eiffel Programming, Use of Eiffel Libraries,

Week 2 - part 2 UML Introduction - use cases, conceptual models

Week 3 Systematic approach to software construction

Client-Supplier relationship; Assertions, Exceptions

Object Analysis & Design - UML - Intro to Sequence Diagrams, Collaboration Diagrams

Week 4 OOSE, Inheritance, Polymorphism, Persistence

Object Analysis & Design - UML - Class Diagrams, Design Patterns and UML

Week 5 Object Analysis & Design - UML - Dynamic Models, State Diagrams

Week 6 Object Analysis & Design - UML - State Diagrams and Testing, More on patterns & UML

Week 7 OOSE, Open-Closed Principle, Typing and Binding,

Genericity, Deferred Classes

Week 8 OOSE, Multiple Inheritance, Use of Eiffel Libraries

Week 9 Declaration by association, Constants

and Shared Objects

Week 10-11 More aspects of Eiffel, OOSE

Week 11 Revisit Reuse

Week 12 Class Test (10%)

Week 13 Object oriented Programming System - Revision

 

Final Examination 40%

 

Laboratory Sessions:

 

Week 1 Familiarise with ISE Eiffel 4: Environment

Week 2 Object orientation. Classes and responsibilities:

Bank and Account example, pursued further in the

later tutorials; Creating Objects

Defining ADTs; Assertions and Invariants; Using

Classes; reading Class specifications.

Defining Classes; feature = attribute /function/procedure; building systems;

Introduction to Assignment

Week 3 Using Eiffel Libraries - Collection of Objects,

Inheritance/Polymorphism, Persistence

Delineation of tasks by group members and

signing a contract with the tutor (supervisor)

(Refer to "Notes on Deliverables"), SA_TOPS

 

Week 4 Final Submission of Assessment Folder for Bank exercise

Work on Assignment

Week 5 Class Presentation by student groups -

Submission of Draft 1 of use case diagram & Class Diagram for scenario 1 - students need to submit draft 1 ver. but are required to make any changes suggested by the tutors

Week 6 Interact with the Internet environment for learning about OO testing - stage 1 of module 1 - Part of the progressive participation/assessment component; Work on scenario 1

 

MID SEMESTER (EASTER) BREAK 10th Spril - 17th April 1998

Week 7 Hand in State Diagrams for a couple of classes from scenario 1 for those classes with clearly identifiable states and complex behaviour. Must include pre,postconditions & invariants to draw out test cases - Refer to LightViews Project pages for more details on state diagrams & testing

Week 8 Hand in Test Plan composing of test suites derived from 1) state diagrams, 2) test cases to cover other aspects of the scenario not covered by 1)

 

Week 8-9 Work/ Assistance on Assignment; Tutor to review/comment on your progress on implementation as well as other aspects of scenario 1 (contd)

 

Week 9 For SFT3021 students only - Work on Scenario 2 (same requirements as for scenario 1 - show progressive work to your tutor each week)

 

Week 10 Scenario 1 Due - Student group demo to the lecturer/tutor

Week 11 Feedback session for scenario 1; Participate in LightViews project - module 2 (students assessed on this aspect as well - week 6 participation was not assessed but recorded as a component of your work requirement.

 

( SFT2021 students do not need to attend week 12 but must

attend week 13 tutorials for their final assessment)

 

Week 12 Refinements (if any) submitted for Ass.

Week 13 Final assessment on assignments

PROGRESSIVE ASSESSMENT: Students must show their tutorial work at the end of each session or the beginning of next session and be prepared to answer questions related to the task completed. You are also required to build your assessment folder on a weekly basis. This must contain hard copies of class listings and other relevant information such as contractual responsibilities of group members, charts and test data for your assignment. The quality and presentation of the work submitted is taken into account in the final grade for the assignments. Participation in the LightViews Project is part of your work requirements to improve your learning about OO testing.

 

BANK Exercise

 

Administration

 

Eiffel 4 in the Pentium Labs from semester 1 1998

Lecture room: A2.11 Tues 6 - 8 pm

Normal Tute times: NT lab F5.20, 12 - 2pm Monday and NT lab & K1.03 8-10pm Tuesdays

(Tutes are for 2 hours duration. Participation, attendance & work during this time is monitored and is part of your progressive assessment component

We also fund the SFTHELP desk and so, make sure you use this facility to your advantage.

Week1 Tute in the Lecture room

 

You will be working in groups of 3 for your assignment. As compiled Eiffel programs are very large, you will have to delete the object files of completed work as you proceed through the tutorials and the assignment.

 

Each group must maintain a folio of work. Work completed during the "BANK" tutorial exercises will result in the creation of sets of Eiffel classes in separate directories. The completed work from tutorial 2 should be copied into a new directory to form the basis for tutorial 3, etc.

rm -r EIFFELGEN is a command you can use within a directory to clear it of all non-source code.

 

Task 1 _

 

FAMILIARISATION WITH ISE EIFFEL 4 ENVIRONMENT

 

BANK Exercise

 

Classes and Responsibilities

 

A Bank maintains a set of Customer Accounts. As the bank has just opened, it offers only basic 'On Call' Accounts. Customers may own many accounts. No overdrafts are allowed, and no interest paid. No transaction statements are provided at the moment, but it is intended to provide them in the future. The only customer information maintained by the bank at the moment is the name of each owner.

 

Design a system to implement Bank Account Processing for a Bank.

 

1. Identify the objects or classes in your system. It may help to think of them as entities.

 

2. Define the responsibilities of each class in your system.

 

3. Try to identify the relationships between the classes - what other classes are involved in assisting a class to carry out a particular responsibility?

 

4. Describe facilities or routines which will allow customers to deposit and withdraw amounts from their account, and to request an account balance.

 

5. Where would you place facilities for printing out:

Bank details

Customer details

Account details?

 

6. What does it mean to create an instance of a class?

Whose responsibility is it to create account and a customer objects?

Whose responsibility is it to:

perform an account withdrawal?

alter the address of a customer?

check if a withdrawal amount is within the credit limit?

7. For each object (class) you have defined, describe:

Its name, Its responsibilities

For each responsibility, collaborators - other classes it interacts with to fulfil a responsibility (if any).

 

Task 2

 

1.Create a sub-directory 'bank-dir2' under your $HOME directory.

Using your favourite editor, enter the text below into a file called bank.e in directory 'bank-dir2':

 

class BANK

creation make

feature

make is

-- Create an instance of Bank.

do

io.putstring ("Welcome to the Bank")

end -- make

end -- Class BANK

 

2. Launch eiffelbench (ebench&). You will be prompted to select ACE, choose it and a new window will be created. Just fill in the ROOT line with the name bank (in lower case), and note that the UNIVERSE line lists the directories containing the Eiffel library clusters kernel, structures and support. Save the changes.

 

3.Click on the Melt button in the system window to produce an executable file called bank. Do not Freeze or Finalise as we will run out of diskspace. The executable is created in a subdir. two levels below the current dir.containing the source files. Change dir. to EIFFELGEN/W_code

 

4.Execute the program by typing bank from W_code subdir. This will display on your screen the message

 

Welcome to the Bank

 

5. Modify bank.e as shown below. Replace the comments with the appropriate requests to ACCOUNT's features.

 

class BANK

 

feature

make is

-- Create an instance of Bank

do

io.putstring("Welcome to the Bank");

io.new_line;

-- create an account object and store its reference

-- in a BANK attribute called account_1

-- open account_1

-- deposit $200 in account_1

-- if there are sufficient funds,

-- withdraw $300 from account-1

-- display account-1's details

end -- make

 

end -- Class BANK

 

6. Compile your system and test it by typing bank.

 

7. Add another attribute, account_2, to class BANK.

Create a new instance of class ACCOUNT and assign its reference to account_2. Test bank by asking account_2 to perform some deposits, withdrawals and to display itself.

.............................................................................

 

 

Task 2 (Contd)

 

1.Create a new directory, bank_dir2a.

 

Copy the files account.e and bank.e from directory bank_dir2 into bank_dir3.

 

In bank_dir2a, change class BANK to allow for user interaction in creating, setting up, depositing, withdrawing and displaying an account.

 

Use MY_FILES for terminal I/O and MENU for manipulating menus. Both of these classes are available for your use.

 

Create a simple menu interface to make processing easier:

 

1. Create and set up an account

2. Deposit

3. Withdraw

4. Display

5. Exit

 

NOTE: Run Eiffelbench in the foreground so that it can read stdin

 

Introduction to Assignment 1 _

...........................................................................

Task 3

Collections of Objects

 

1. Create a new directory, bank_dir3. Copy the files Ace, account.e and bank.e from directory bank_dir2a into bank_dir3.

 

2. We would like to maintain some kind of a collection or list of accounts, indexed by the account number. Browse library class HASH_TABLE to understand how this class works. Discuss how HASH_TABLE would be used to store and access a list of bank accounts. Refine class BANK to provide for access to many accounts.

 

3. In bank_dir3, change class BANK to allow for the creation and maintenance of many accounts, using HASH_TABLE as the container class for storing accounts.

 

4. Add a feature display to BANK which will display all the accounts in the hash_table. Refer to Eiffel sample code to help you code the display routines.

 

5. Start on Inheritance/Polymorphism exercise

 

Task 3 (Contd)

 

. Inheritance/Polymorphism

. Persistence

 

1.Create a new directory, bank_dir3a.

 

Copy the files Ace, account.e and bank.e from directory bank_dir3 into bank_dir3a.

 

2.The bank has decided to provide cheque accounts with overdraft limits,

 

How does a Cheque account differ from an On-call account?

 

Define the ADT of a cheque account

 

What features are common to both On-call and Cheque accounts?

 

What features are implemented differently for On-call and Cheque accounts?

 

Define an abstract, deferred class ACCOUNT. Define 2 sub-classes of ACCOUNT, ON-CALL and CHEQUE.

 

3.Change BANK to allow the user to decide at run-time what kind of new account is to be created. Bank.e will have two local attributes (on_call_account and cheque_account) as well as an_account. Depending on the user's response, create an instance of the appropriate specialised type and assign it to an_account.

 

Test your code by asking the newly created account to print itself out.

 

4.Change class BANK so that is uses STORABLE, and as described in lectures, make BANK and all its dependents persistent.

 

General assistance with the Assignment .

 

Task 4

 

Final Submission of Assessment folder for the Bank exercise.

Comparison of Banking system and the assignment.

 

 

 

Assignment

 

Refer to the Case study description for this assignment.

You are required to produce UML diagrams as part of O-O design and implement the system in Eiffel.

 

The Programming assignment is divided into stages. It is strongly recommended that you also implement the project in stages. As object oriented system development allows you to 'program by refinement', you will find this involves no extra effort, and gives you achievable milestones. Each stage must be stored on separate directories. A hard copy of the code and documentation is required for each stage.

 

To be Handed in:

 

UML diagrams.

 

Class listings plus other documentation as specified. It is strongly recommended that you keep in separate directories the classes marking the achievement of each stage of the project.

The documentation for the system is checked progressively and the final documentation is due on week 13. More specific submission details are with the Assignment handout.

Final submission may include any amendments for the documentations submitted thus far.

 

Documentation must be produced in duplicate: one for the lecturer and the other to be submitted to the tutor. Copy your documentation on to the disc to be provided by the lecturer for ongoing software engineering measurement experiments.