CSE 301 Exam Revision Lecture

Slides:



Advertisements
Similar presentations
Exceptions CSE301 University of Sunderland Harry Erwin, PhD.
Advertisements

1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
General OO Concepts and Principles CSE301 University of Sunderland Harry R. Erwin, PhD.
Lecture 9 Improving Software Design CSC301-Winter 2011 – University of Toronto – Department of Computer Science Hesam C. Esfahani
SOLID Object Oriented Design Craig Berntson
ITEC200 – Week03 Inheritance and Class Hierarchies.
Software Engineering and Design Principles Chapter 1.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Object-Oriented PHP (1)
Inheritance. Extending Classes It’s possible to create a class by using another as a starting point  i.e. Start with the original class then add methods,
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
1 Inheritance and Polymorphism Inheritance (Continued) Polymorphism Polymorphism by inheritance Polymorphism by interfaces Reading for this lecture: L&L.
Aalborg Media Lab 23-Jun-15 Inheritance Lecture 10 Chapter 8.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
Chapter 10 Classes Continued
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Programming Languages and Paradigms Object-Oriented Programming.
CISC6795: Spring Object-Oriented Programming: Polymorphism.
An Object-Oriented Approach to Programming Logic and Design
Recap (önemli noktaları yinelemek) from last week Paradigm Kay’s Description Intro to Objects Messages / Interconnections Information Hiding Classes Inheritance.
1 Object-Oriented Software Engineering CS Interfaces Interfaces are contracts Contracts between software groups Defines how software interacts with.
Polymorphism, Inheritance Pt. 1 COMP 401, Fall 2014 Lecture 7 9/9/2014.
Company Confidential – Do Not Duplicate 2 Copyright 2008 McLane Advanced Technologies, LLC S.O.L.I.D. Software Development Achieving Object Oriented Principles,
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION MIDTERM REVIEW Autumn 2011.
APCS Java AB 2004 Review of CS1 and CS2 Review for AP test #1 Sources: 2003 Workshop notes from Chris Nevison (Colgate University) AP Study Guide to go.
© 2004 Capgemini - All rights reserved SOLID - OO DESIGN PRINCIPLES Andreas Enbohm, Capgemini.
Introduction to SOLID Principles. Background Dependency Inversion Principle Single Responsibility Principle Open/Closed Principle Liskov Substitution.
S.O.L.I.D. Software Development 12 January 2010 (Martin Verboon, Patrick Kalkman, Stan Verdiesen)
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
Object Oriented Software Development
Incremental Design Why incremental design? Goal of incremental design Tools for incremental design  UML diagrams  Design principles  Design patterns.
Elements of OO Abstraction Encapsulation Modularity Hierarchy: Inheritance & Aggregation 4 major/essential elements3 minor/helpful elements Typing Concurrency.
REFACTORINGREFACTORING. Realities Code evolves substantially during development Requirements changes 1%-4% per month on a project Current methodologies.
Chapter 14 Abstract Classes and Interfaces. Abstract Classes An abstract class extracts common features and functionality of a family of objects An abstract.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 11a: Component-Level Design Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Object Oriented Programming
Chapter 10: Introduction to Inheritance. Objectives Learn about the concept of inheritance Extend classes Override superclass methods Call constructors.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 9 Java Fundamentals Objects/ClassesMethods Mon.
High Cohesion Low Coupling Old Standards for Object Oriented Programming.
Five design principles
ISBN Object-Oriented Programming Chapter Chapter
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
Principles of Object Oriented Design
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
SOLID Design Principles
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Terms and Rules II Professor Evan Korth New York University (All rights reserved)
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
CSCE 240 – Intro to Software Engineering Lecture 3.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
EE2E1. JAVA Programming Revision Lecture.
Inheritance and Polymorphism
Software Engineering: A Practitioner’s Approach, 6/e Chapter 11 Component-Level Design copyright © 1996, 2001, 2005 R.S. Pressman & Associates, Inc.
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
Object Oriented Practices
lecture 08, OO Design Principle
Software Design Lecture : 14.
A (partial) blueprint for dealing with change
Object Oriented Design & Analysis
Chapter 10 – Component-Level Design
Presentation transcript:

CSE 301 Exam Revision Lecture

Exam Format Wednesday, 18 May 9:30-12:30 Seaburn Centre 14 Questions in total, Three sections;  OO Programming (6 questions)  OO Theory (4 questions)  OO Practice (4 questions) Answer TEN questions, with at least TWO from each section

Specific Advice Know your Java syntax (ch 2-3, JiaN) Know how to use the Collection classes Know the basic patterns from the Pattern book Know how Java implements the concepts of OO programming Know the concepts, principles and theory of OO Know how to use UML Know the risks and practices discussed in the text Understand the practices of XP

Basic Programming Topics Java Operators and Syntax Primitive Types (definitions and conversion) Reference Types (including the Object class) Access Modifiers Inner Classes Iterators Interfaces Constructors & Constructor Chaining

Intermediate and Advanced Programming Topics Input/Output Exception Handling Collection Classes Threads and Semaphores Swing and AWT Interfacing to the Internet, Serialization, and RMI Patterns Garbage Collection

Theory Topics Definitions (Object, System, etc.) Interface Segregation Principle (ISP) Open-Closed Principle (OCP) Liskov Substitution Principle (LSP) Dependency Inversion Principle (DIP) Single-Responsibility Principle (SRP) Meyer’s Design By Contract Encapsulation, Inheritance, Subtype- Polymorphism & Abstraction

Practice Topics UML (eg Class diagrams, state charts, use cases, interaction diagrams, etc.) Bad Software Design (when software smells) Design Patterns Modelling Classes Requirements Analysis Software Maintainability The Text in General Refactoring, TDD, XP

Questions from the Past Name and describe the 8 primitive types  Boolean, char, etc. How is a type conversion done?  When is it suitable (think data loss)?  Wrapper classes Describe the three categories of reference data types (that inherit from Object).  Class instance, array, interface

Questions from the Past Name the methods Object class provides  toString(), clone(), getClass(), equals(), etc. How is a class instantiated?  Simple code: public Balance currentBalance = new Balance(); What is a static method?  Method not associated with an instance – but rather at class level

Questions from the Past Describe 4 access modifiers  Remember table! Accessible to:PublicProtectedPackagePrivate Defining ClassYes Class in same packageYes No Subclass in different packageYes No Non-sublcass different packageYesNo

Questions from the Past What is an inner class and how is it used?  Class within a class Static Member class Member class Local class Anonymous class

Questions from the Past What is an iterator  Allow processing (step through) of each element of a collection  Sample code has been asked for! Iterator myIterator= myCollection.iterator(); while(myIterator.hasNext()){ Object myObject = myIterator.next(); //do something with myObject – possibly cast }

Questions from the Past What is an interface?  a collection of method definitions and constant values that define a behaviour  Replace multiple inheritance – more than one interface can be inherited.  Does not implement methods however What is a thread?  a separate stream of execution that takes place simultaneously with and independently of everything else – remember Thread class and Runnable interface

Questions from the Past What is an Exception? How is it dealt with in Java?  An Exception is an object created and thrown when an exceptional circumstance (usually caused by an erroneous condition) occurs  Java – try, catch, throw, throws, finally  Know the different types of Exceptions and how the compiler enforces them.

Questions from the Past What is a constructor?  General description, code example might help What is constructor chaining?  A child object constructor always first needs to construct its parent (which in turn calls its parent constructor.). Can also be ‘manufactured’ by enforcing other constructors to be called within the same or parent classes  Use of this, this(), super, and super()

Questions from the Past Describe the Interface Segregation Principle (ISP)?  Many client specific interfaces (narrow) are better than one general purpose interface  Fat interfaces lead to inadvertent coupling Describe the Liskov Substitution Principle (LSP)?  Subclasses should be suitable for their base classes  The contract of the base class must be honoured by the derived class

Questions from the Past What is the Open-Closed Principle (OCP)?  A module (class) should be open for extension but closed for modification (originally by Bertrand Meyer).  Classes should be written so that they can be extended without requiring the classes to be modified.  To extend the behavior of a system (in response to a requested change) add new code, don’t modify existing code.

Questions from the Past Describe the Dependency Inversion Principle (DIP)  Depend upon abstractions. Do not depend upon concrete implementations  High level classes should not depend on low level classes.  Abstractions should not depend upon the details.  If the high level abstractions depend on the low level implementation details, then the dependency is inverted from what it should be.

Questions from the Past Describe the Single-Responsibility Principle (SRP)  A class should have only one reason to change  A responsibility is “a reason for change.”  The responsibilities of a class are axes of change. If it has two responsibilities, they are coupled in the design, and so have to change together.

Questions from the Past Meyer’s Design By Contract (later version)  A contract consists of the preconditions a method expects and the post-conditions it guarantees if it returns successfully.  If the method doesn’t return successfully, it throws an exception.  The contract is associated with the public methods of a class or interface.

Questions from the Past Describe symptoms of bad software design (think when software smells)  The system is rigid—hard to change because everything has to change at once.  The system is fragile—changes cause the system to break in the strangest of places.  The system is immobile—not reusable.  The system is viscous—doing things right is hard.  The system is needlessly complex.  The system contains needless repetition.  The system is opaque—hard to understand

Questions from the Past Describe what is meant by encapsulation  Diagram might help Describe what is meant by inheritance  Keywords may also help (extends) Describe what is meant by subtype- polymorphism  The ability of an object or operator to refer to instances of different classes at run time.

Questions from the Past How is abstraction achieved in Java?  Various ways – Abstract (keyword) classes, interfaces and inheritance Describe a State chart / Use Case Diagram / Class Diagram / Interaction Diagram  Diagram essential – key is to remember all elements of the diagram  Know what they’re used for.

Questions from the Past How might you gather and analyze requirements? Compare and contrast the approaches.  Brainstorming, Observation etc. Discuss and criticize the design principles the authors claim lead to maintainable software  Design and conquer  Increase cohesion where possible  Reduce coupling where possible  Keep the level of abstraction as high as possible  Increase reusability where possible  Reuse existing designs and code where possible  Anticipate obsolescence  Design for portability  Design for testability  Design defensively

General Advice Read through whole paper once – work out which questions you answer best. With 3 hours you have ~18 minutes per question Good luck!!!