Docsity

Object-Oriented Programming: A Practical Introduction with Java using BlueJ, Study Guides, Projects, Research of Information Technology

Toggle sidebar
bg1
1
Object-Oriented Programming
04:547:202 (02)
Instructor: Gheorghe Muresan
Based on:
Objects First with Java
A Practical Introduction using BlueJ
David J. Barnes
Michael Kölling
1.0
2
Course Contents
•Introduction to object-oriented
programming…
•…with a strong software engineering
foundation…
•…aimed at solving problems by
producing and maintaining high-quality
software systems.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Object-Oriented Programming: A Practical Introduction with Java using BlueJ and more Study Guides, Projects, Research Information Technology in PDF only on Docsity!

Object-Oriented Programming

Instructor: Gheorghe Muresan

Based on: Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling

Course Contents

  • Introduction to object-oriented

programming…

  • …with a strong software engineering

foundation…

  • …aimed at solving problems by

producing and maintaining high-quality

software systems.

3

Goals

  • Sound knowledge of programming principles and concepts
  • Sound knowledge of object-orientation
  • Able to critically assess the quality of a (small) software system
  • Able to implement a small software system in Java

Note. Understanding principles is more important than learning Java syntax, so that, in the future, you can use other programming languages.

What is programming

  • Narrow definition
    • Using some programming language to write code, based on some specification - Boring, nerdy
  • Broader definition
    • Using creative thinking and engineering rigor to solve problems using the computer - Involves analyzing a situation, designing a solution, choosing the appropriate language and coding the solution, testing - It is exciting, challenging and … HARD

7

Why Programming in ITI?

  • As ITI professionals, you will need:
    • Creative and problem-solving skills
    • To work with programmers, understand how they think, be able to communicate with them
    • To have knowledge of common practices and methodology employed in analysis, design and programming in order to contribute to your team
  • It can be useful and fun, challenging and

satisfying

A career in IT

  • Attractions to Information Technology / Computer Science - Creating something that will benefit others - Using the computer to solve problems - Usefulness in supporting other areas/field

9

Non-IT careers using IT

  • Research in cutting-edge areas
    • Genomics, Pharmaceuticals
    • Nanotechnology
    • Nuclear Physics, Cosmology
    • Weather simulation
    • Information retrieval Most of these researchers need programming; they learn it out of pleasure or necessity
  • Almost anything, to a certain extent

Is math a pre-requisite for IT?

  • No, math background is not a pre-

requisite, but it is useful

  • Ability to think in abstract terms and to

build models

  • Different math areas can help in certain

types of problems (ex: geometry &

trigonometry for graphical applications,

statistics in search engines)

13

Problem solving (Polya applied)

  • Understand the problem
  • Devise a plan for solving the problem
    • Think how an algorithmic procedure might solve the problem
  • Carry out the plan
    • Formulate the algorithm and represent it as a problem
  • Evaluate the solution for accuracy and for its

potential as a tool for solving other problems

Note. Reading and understanding other people’s

programs is good training for programming.

Complex problem solving

  • Goals, objectives
    • What are the tasks you are trying to achieve?
  • Divide and conquer
    • Is the problem too large to grasp? Can it be broken into smaller problems? Can the solutions to the smaller problems be assembled to give the overall solution? - Ex: Planning to climb Everest with a group of friends. What do you need to arrange? - Finance (savings or sponsorship); training (fitness, high altitude survival, ice-climbing technique); timing; visas, permits and guides; equipment, clothing and food; medical considerations; safety issues

15

Algorithms and programs

  • Algorithm = an ordered set of

unambiguous steps (used typically for

solving a task)

  • Program = set of instructions that tell

the computer what to do (i.e. the steps

it needs to take) (i.e. how to implement

an algorithm)

  • Programming language = set of symbols

and rules used to describe an algorithm

(i.e. to write a program)

Representing algorithms

  • Why?
    • So that we are not constrained by a certain programming language
    • So that we describe the algorithm at various levels of abstraction, gradually increasing the specificity
  • Pseudocode – instructions in plain

English

  • Diagrams – graphical display may be

clearer for some people

  • Flow-charts
  • Activity diagrams (UML)

19

Elements of software design

  • When designing a program think of
    • The main purpose of the program
    • The tasks and subtasks that make up the object of the program
    • Decide what paradigm and what programming language is more appropriate - Ex: Perl good for text processing, COBOL for financial applications, FORTRAN for mathematical calculations, C++ for large projects that require efficiency, Java for multi-platform distributed applications, … - Think of cost, availability of tools and skills, maintenance, …
    • Think of possible future extension of the program and design accordingly

Dealing with complexity

  • Reminder: a program models reality and attempts to solve a problem or to undertake a task
  • Humans have different ways of dealing with complexity - Divide and conquer – split complex tasks into smaller and more simple ones - Team-working – assign different tasks, at various levels of complexity, to teams and individuals - Each team or person is responsible for making sure that their task was completed; they report results or errors - There has to be some higher level of control that assign tasks, puts results together, and is responsible for the overall task

21

Object-oriented

software engineering

  • Object-oriented software engineering (analysis, design, programming & testing) attempts to simulate - The real problem domain - Objects and classes in the software application correspond to objects and concepts in the real world (Account, Bank, Customer, …, in a financial application) - The way people work on projects or to solve problems - For small problems, one person may be able to do all the work - Larger problems / projects require teamwork; each person specializes for a certain task or aspect of the problem and plays a role; people need to communicate, to exchange information and to synchronized their activities; their work is coordinated by managers - Objects and classes correspond to people and roles

Object-oriented

software engineering

  • A software project is similar to a company in terms of structure and functionality - There is a public class that represents the CEO and has ultimate control and responsibility - Tiny programs (contractors) consist of one class with a main role (method) - Small programs (companies) consist of one class (person) with several methods, one for each role (function) - Medium programs (companies) consist of several classes (people) that interact. One is the CEO. - Large programs (companies) consist of many classes (people), grouped in packages (departments); each package specializes in some aspect of the overall job; objects of each class specialize in specific tasks

25

Learning OOA/D/P with Java

and BlueJ

  • We’ll use the modern approach (realistic conversation before vocabulary and grammar), so don’t worry if you don’t understand everything; we’ll iterate over concepts
  • BlueJ allows visualization of programming concepts, as well as interactive exploration of existing classes and objects and access to object methods
  • We’ll work around simple projects; you can use your creativity to make them as realistic as possible
  • Time permitting, we’ll get into Visual Programming, which supports the creation of complex applications with little coding

The secret of success

  • Try to understand the concepts, rather than the language details
  • Don’t fall behind! We keep building on what was taught in previous weeks
  • Do the readings and try the exercises
  • Practice, practice, practice!

27

Course overview (1)

  • Objects and classes
  • Understanding class definitions
  • Object interaction
  • Grouping objects
  • More sophisticated behavior - libraries
  • Well-behaved objects - testing, maintaining,

debugging

  • Designing classes

Course overview (2)

  • Inheritance
  • Polymorphism
  • Extendable, flexible class structures
  • Handling errors
  • Designing applications
  • Intro to building graphical user

interfaces (GUI) – time permitting