Sayed Ahmed Computer Engineering, BUET, Bangladesh Masters from the University of Manitoba, Canada

Slides:



Advertisements
Similar presentations
CS 106 Introduction to Computer Science I 04 / 11 / 2008 Instructor: Michael Eckmann.
Advertisements

Abstract Classes and Interfaces The objectives of this chapter are: To explore the concept of abstract classes To understand interfaces To understand the.
Inheritance Inheritance Reserved word protected Reserved word super
Introduction to Object Oriented Programming Java.
OBJECT-ORIENTED PROGRAMMING. What is an “object”? Abstract entity that contains data and actions Attributes (characteristics) and methods (functions)
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
ITEC200 – Week03 Inheritance and Class Hierarchies.
CS 106 Introduction to Computer Science I 11 / 26 / 2007 Instructor: Michael Eckmann.
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,
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
1 :)Advanced:) Visual Basic laura leventhal and julie barnes.
Patterns Lecture 2. Singleton Ensure a class only has one instance, and provide a global point of access to it.
March 2004Object Oriented Design1 Object-Oriented Design.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS 106 Introduction to Computer Science I 04 / 16 / 2010 Instructor: Michael Eckmann.
Course Map The Java Programming Language Basics Object-Oriented Programming Exception Handling Graphical User Interfaces and Applets Multithreading Communications.
Building Java Programs Inner classes, generics, abstract classes reading: 9.6, 15.4,
Chapter 2 Architectural Models. Keywords Middleware Interface vs. implementation Client-server models OOP.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
CSE 332: C++ templates This Week C++ Templates –Another form of polymorphism (interface based) –Let you plug different types into reusable code Assigned.
CS 4240: Bridge and Abstract Factory Readings:  Chap. 10 and 11 Readings:  Chap. 10 and 11.
SWE 316: Software Design and Architecture – Dr. Khalid Aljasser Objectives Lecture 11 : Frameworks SWE 316: Software Design and Architecture  To understand.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
Inheritance and Class Hierarchies Ellen Walker CPSC 201 Data Structures Hiram College.
Sayed Ahmed BSc. Engineering in Computer Science and Engineering, BUET, Bangladesh MSc. in Computer Science, University of Manitoba, Canada Owner/Architect/Developer.
An analysis of exam results in the Object-Oriented Programming course at „Politehnica” University of Timisoara Ioan Jurca.
Polymorphism, Inheritance Pt. 1 COMP 401, Fall 2014 Lecture 7 9/9/2014.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Chapter 2 Introducing Interfaces Summary prepared by Kirk Scott.
1 CSC 222: Object-Oriented Programming Spring 2013 Course goals:  To know and use basic Java programming constructs for object- oriented problem solving.
1/20/03A2-1 CS494 Interfaces and Collection in Java.
L11-12: Design Patterns Definition Iterator (L4: Inheritance)‏ Factory (L4: Inheritance)‏ Strategy (L5: Multiple Inheritance)‏ Composite (L6: Implementation.
CS 151: Object-Oriented Design September 26 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
OBJECT-ORIENTED PROGRAMMING (OOP) WITH C++ Instructor: Dr. Hany H. Ammar Dept. of Electrical and Computer Engineering, WVU.
Dale Roberts Object Oriented Programming using Java - Introduction Dale Roberts, Lecturer Computer Science, IUPUI Department.
Define an interface for creating an object, but let subclasses decide which class to instantiate Factory Method Pattern.
Define an interface for creating an object, but let subclasses decide which class to instantiate.
Real Time Programming Language. Intro A programming language represents the nexus of design and structure. But misuse of the programming language can.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Object Oriented Programming
Interfaces About Interfaces Interfaces and abstract classes provide more structured way to separate interface from implementation
Design Patterns Software Engineering CS 561. Last Time Introduced design patterns Abstraction-Occurrence General Hierarchy Player-Role.
Inspired by the Oulipu. The 3 Tenets of OO Encapsulation Polymorphism Inheritance.
The Template Method Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
The Factory Method Pattern (Creational) ©SoftMoore ConsultingSlide 1.
The Strategy Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
CS 325: Software Engineering March 19, 2015 Applying Patterns (Part B) Code Smells The Decorator Pattern The Observer Pattern The Template Method Pattern.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
Chapter 11: Advanced Inheritance Concepts. Objectives Create and use abstract classes Use dynamic method binding Create arrays of subclass objects Use.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Week 5, Day 2: Decorator Decorators Muddiest Point Tomorrow: Quiz on lab reading: web.msoe.edu/hasker/se2811/labs/5/ SE-2811 Slide design:
Object- oriented Design Principles
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Comp1004: Object Oriented Design I Abstract Classes and Interfaces.
CSC 222: Object-Oriented Programming
MPCS – Advanced java Programming
Section 11.1 Class Variables and Methods
Interfaces.
Interfaces.
CS 350 – Software Design Principles and Strategies – Chapter 14
Object-Oriented Programming
Abstract Classes and Interfaces
CS 325: Software Engineering
Abstract Classes and Interfaces
Software Engineering and Architecture
Presentation transcript:

Sayed Ahmed Computer Engineering, BUET, Bangladesh Masters from the University of Manitoba, Canada

Java Class Design Advanced Class Design Object-Oriented Design Principles Generics and Collections String Processing Exceptions and Assertions Java I/O Fundamentals Java File I/O (NIO.2) Building Database Applications with JDBC Threads Concurrency Localization

 table/exam2-checklist/ table/exam2-checklist/

 choose-inheritance-over-an-interface-when-designing-c-sharp-class choose-inheritance-over-an-interface-when-designing-c-sharp-class  Their general recommendations are as follows:  Do favor defining classes over interfaces.  Do use abstract classes instead of interfaces to decouple the contract from implementations. Abstract classes, if defined correctly, allow for the same degree of decoupling between contract and implementation.  Do define an interface if you need to provide a polymorphic hierarchy of value types.  Consider defining interfaces to achieve a similar effect to that of multiple inheritance.  Chris Anderson expresses particular agreement with this last tenant, arguing that:  Abstract types do version much better, and allow for future extensibility, but they also burn your one and only base type. Interfaces are appropriate when you are really defining a contract between two objects that is invariant over time. Abstract base types are better for defining a common base for a family of types.

 interface-and-when-to-extend-a-superclass interface-and-when-to-extend-a-superclass  Use an interface if you want to define a contract. I.e. X must take Y and return Z. It doesn't care how the code is doing that. A class can implement multiple interfaces.  Use an abstract class if you want to define default behaviour in non-abstract methods so that the endusers can reuse it without rewriting it again and again. A class can extend from only one other class. An abstract class with only abstract methods can be as good definied as an interface. An abstract class without any abstract method is recognizeable as the Template Method pattern (see this answer for some real world examples).Template Methodthis answer  An abstract class in turn can perfectly implement an interface whenever you want to provide the enduser freedom in defining the default behaviour.

 ndI/createinterface.html ndI/createinterface.html

 p5.html p5.html  mming/programming-guides/892-is-a-and-has- a-relationships.html mming/programming-guides/892-is-a-and-has- a-relationships.html

 /disadvantage-of-object-composition-over-class- inheritance /disadvantage-of-object-composition-over-class- inheritance  _inheritance _inheritance

 OOPrinciples.pdf OOPrinciples.pdf

 /jw-0425-designpatterns.html?page= /jw-0425-designpatterns.html?page=2    Singleton/article.html

 essobject html essobject html  Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.   essobject html essobject html  essobject html essobject html

 ferences-between-abstract-factory-pattern-and- factory-method ferences-between-abstract-factory-pattern-and- factory-method  The main difference between a "factory method" and an "abstract factory" is that the factory method is a single method, and an abstract factory is an object  there is an object A, who wants to make a Foo object. Instead of making the Foo object itself (e.g. with a factory method), it's going get a different object (the abstract factory) to create the Foo object.  ern ern