Presentation is loading. Please wait.

Presentation is loading. Please wait.

Objected Oriented Programming & Design JAVA Shishir Gupta (704) 947 2181 (704) 944 8864.

Similar presentations


Presentation on theme: "Objected Oriented Programming & Design JAVA Shishir Gupta (704) 947 2181 (704) 944 8864."— Presentation transcript:

1 Objected Oriented Programming & Design JAVA Shishir Gupta Shishir@shishir.net http://www.shishir.net (704) 947 2181 (704) 944 8864

2 AGENDA F Text F Setup for the class. F Quick Introduction. –Your Name –Your Job –Any Past Programming Experience F Information on the course. F Course Policies F Course Evaluation F Calendar (Tentative) F Introduction OOP & Java.

3 TEXT Thinking In Java Bruce Eckel http://www.EckelObjects.com http://www.BruceEckel.com

4 Setup F Create “temp” directory on the D: drive. F Copy all the files from the CD. F Install JDK & Forte. F Install JDK Documentation. F Install Examples from the Text.

5 Introduction F Your Name F Your Job F Any Past Programming Experience. F Your Expectations from this course. F Your E-Mail Address

6 Course Policies F Honor Code F Attendance F Assignments F Class –Interactive/Responsive. –Make sure that you know everything that is said in the class before you leave. –Feel free to ask when in doubt. –There is no limit to asking questions.

7 Evaluation – Assignment (60%) F Grades will be awarded on assignments and the Final Project. F Assignments will be given at the beginning of the Week and will be based on the course to be covered that week. F The assignments will be due beginning the following week F Late Submission will not be accepted. F Assignments will be graded as follows: –100% : Program that compiles and runs correctly. – 80% : Program compiles but does not run correctly. – 60% : program that compiles but does not run. – 40% : Programs that do not compile.

8 Evaluation – Project (40%) F Should be a full fledged JAVA application. F The application should use the following programming features. –JDBC –SWING –CORBA or RMI F Groups may choose to implement the Work they had done in Software Engineering Class last Semester (Fall). F Maximum of 3 people per group. F The final presentation of the project should consist of the following: –10 minutes PowerPoint Presentation & demo of the application developed. –3 Minutes for answering questions after the presentation. –All members of the team must participate in the presentation and demonstration of the application. –The final submission of the project document should consist of a copy of your presentation and your application on a floppy diskette. F Extra credit will be given to groups who choose to implement their software using Rational Rose.

9 Calendar (Tentative)

10

11 Introduction to OOP Abstraction –Describe the solution in terms of the problem rather than the Computer on which where the solution runs. –Allows user to define his/her own data type and use them as they were a basic language type. This user defined type can be anything e.g. TABLE, CHAIRS etc. –Programmers define their own type and provide a full set of operation with each type. –Thinking in terms of types one wants, an object is just not data & functionality bundled together in any fashion, but it is tightly related to the idea of ADT: a user defined type. –Abstract data type work's the same way like built in types (CLASS). You can create a variable of this type and mani

12 Introduction to OOP Characteristics : –Everything is an Object. –A program is a bunch of objects telling each other what to do by sending messages. –Each object has its own memory made up of other objects. –Every Object has a Type. –All Objects of a particular type can receive the same messages.

13 Introduction to OOP Class –Definition of the object. –Class describes a set of objects that have identical characteristics and behavior. Object –Instantiation of the class.

14 Introduction to OOP Interface –Request you can make to a specific object. –There must be code to satisfy the request. Implementation –Interface with Hidden Data

15 Introduction to OOP The hidden Implementation F The access specifiers determine who can use the definition that follows. –PUBLIC –PRIVATE –PROTECTED F If not specified “FRIENDLY” (default) access is used.

16 Introduction to OOP Reusing the Implementation –Reuse a class as an object of another class. –Also called Aggregation or Composition. –Composition is also referred to as “HAS-A” relationship. –The member object of the new class is usually “private” which make them unavailable to outside classes. –Is generally a preferred choice over “Inheritance”

17 Introduction to OOP Inheritance –Cloning an existing Class and making modifications to the Clone. –Inheriting class inherits the functionality of the Parent. –The Inheriting class is of “Parent” Type. –Can take all the message the parent can take plus more. BASE DERIVED

18 Introduction to OOP Inheritance –When inherit from an existing type, you create a new type. –Duplicates the interface of the base class. –Messages that can be sent to the base class can also be sent to the derived class. –Derived Class is the same type as the base class (Circle is a Shape).

19 Introduction to OOP Inheritance (what to do with the derived class) –Add a brand new function to the derived class. –Change the existing behavior also known as overriding that function. –“Extends” keyword is used in Java to inherit from a existing base class.

20 Introduction to OOP Inheritance (IS-A vs LIKE-A Relationship) –If the Derived Class only overrides function of the base class. The derived class is exactly like the Base Class. Any message that can be sent to the derived class can also be sent to the Base class. –Adding new Interface elements to the derive class extends the interface and creates a new type. The new type can still substitute the base type, but the new functions are not accessible from the base type.

21 Introduction to OOP Polymorphism –Treat a Derived Type as a Base type. –Late Binding. There is no way to determine the address of the code until runtime. –The ability to extend a program easily by deriving new subtypes is important because it greatly improves design while reducing the cost of S/W Maintenance. –Upcasting.

22 Introduction to OOP (Concepts) Abstract Class and Interface F Provide only an interface for the derived class. F We do not want to create an object of the base class; only to upcast it so that the interface can be used. F Derived classes must implement methods that are abstract or they become abstract class themselves. F Interface does not provide any method definition at all. F Many Interface can be inherited together in Java.

23 Object Landscapes & Lifetime F Object Creation and Destruction. F Objects stored in Heap rather than on Stack. F Objects are created with “new” keyword. F Objects are destroyed using Garbage Collector.


Download ppt "Objected Oriented Programming & Design JAVA Shishir Gupta (704) 947 2181 (704) 944 8864."

Similar presentations


Ads by Google