Course Info

Welcome to Programming 2 - Advanced Object-Oriented Programming!

In your first programming course, you learned about structured programming. This course will use Java to focus on object-oriented programming (OOP). Object-oriented programming builds on the three structures you already know - sequence, selection, and iteration (repetition or looping). To create object-oriented programs, we must first review the concepts in structured programming. We will quickly get into the concept of OOP.

Object-oriented programming (OOP) is a computer programming model that organizes software design around data or objects rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior. OOP focuses on the objects that developers want to manipulate rather than the logic required to manipulate them. This programming approach is well-suited for large, complex, and actively updated or maintained programs. 

The organization of an object-oriented program also makes the method beneficial to collaborative development, where projects are divided into groups. Additional benefits of OOP include code reusability, scalability, and efficiency.

Object-oriented programming (OOP) is a programming paradigm that uses objects to represent data and behavior. Objects are self-contained units of code that can be used to create complex programs. OOP is based on the following four concepts:

  • Classes: Think of a class as a blueprint for creating objects. A class defines the properties (data fields) and behaviors (methods) that the objects created from it will have.

  • Objects: These are instances of classes. An object in OOP is a self-contained component that consists of methods and properties to make a particular type of data useful. Object properties can include things like color, size, text, or numbers.

  • Aggregation: This is a particular type of association in which objects are assembled or configured together to create a new object. It's often referred to as a "has-a" relationship, where one object is a part of another object.

  • Encapsulation: This is the practice of keeping the fields (data) in a class private and then providing public methods (getters and setters) to access and modify them. It's a protective barrier that keeps the data and code safe within the object and prevents unauthorized access.

  • Inheritance: This is a mechanism where a new class is derived from an existing class. The new class, known as a subclass, inherits the attributes and methods of the parent class. It allows for reusability of code and can be thought of as a "is-a" relationship.

  • Polymorphism: This concept allows objects of different classes to be treated as objects of a common superclass. It's the ability of different classes to respond to the same method call in different ways.

  • Interfaces: An interface in OOP is a completely "abstract class" that is used to group related methods with empty bodies. Implementing an interface allows a class to become more formal about the behavior it promises to provide.

  • Abstraction: This is the concept of hiding the complex reality while exposing only the necessary parts. It's a way of creating a simple model of a more complex underlying entity, which includes only the details that are relevant to the current perspective.

  • Object Design: This is a phase in the software development process that involves planning the structure and relationships between different objects in a system. It's where the conceptual model is translated into actual code.

OOP has several advantages over structured programming, including:

  • Increased code reusability - OOP allows developers to reuse code by creating objects that encapsulate data and behavior. This can save time and effort, and it can also improve the quality of the code.

  • Improved code readability and maintainability - OOP makes code more readable and maintainable by grouping related data and behavior together. This makes it easier to understand how the code works, and it makes it easier to make changes to the code without breaking other parts of the program.

  • Increased scalability - OOP makes programs more scalable by making it easy to add new features and functionality. This is because new objects can be created without affecting the existing code.

  • Improved performance - OOP can improve the performance of programs by reducing the amount of code that needs to be executed. This is because objects can be used to encapsulate common tasks, and these tasks can be executed more efficiently than if they were executed separately.

Overall, OOP is a powerful programming paradigm that can be used to create more complex, reusable, and maintainable programs.

Course Learning Objectives

  • (CO-1) Identify and explain a programming development lifecycle, including planning, analysis, design, development, and maintenance.

  • (CO-2) Demonstrate an understanding of object-oriented programming by using structs and classes in software projects.

  • (CO-3)Use object-oriented programming techniques to develop executable programs that include elements such as inheritance and polymorphism.

  • (CO-4)  Document and format code in a consistent manner.

  • (CO-5) Apply basic searching and sorting algorithms in software design.

  • (CO-6) Apply single- and multi-dimensional arrays in software.

  • (CO-7) Use a symbolic debugger to find and fix runtime and logical errors in software.

  • (CO-8) Describe the phases of program translation from source code to executable code.

Additional Instructor Objectives

  • (CO-9) Develop well-documented programs using best practices

  • (CO-10) Create classes incorporating object-oriented techniques

  • (CO-11) Use data abstraction, polymorphism, inheritance, and interfaces.

  • (CO-12) Apply Object Design Patterns 

 

COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark