SlideShare a Scribd company logo
1 of 34
An Introduction to Software Development Java Methods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin, and Skylight Publishing.  All rights reserved . TM ch    3
Objectives: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Software Today: 84,700,000
Software Applications ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Software Development ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Early era (1950s) : Now :
Programming Languages 1940  1950  1960  1970  1980  1990  2000 Machine code Assembly languages Fortran Basic Pascal Scheme C C++ Java LISP Smalltalk  Smalltalk-80 C# Logo
Algorithms ,[object Object],[object Object],[object Object],[object Object],“ A more or less abstract, formal, and general step-by-step recipe that tells how to perform a certain task or solve a certain problem.”
Properties of Algorithms ,[object Object],[object Object],[object Object]
Pseudocode and Flowcharts 1. Start at pos0, facing dir0 2. If wall in front, turn 90º clockwise else go forward 3. If back to initial position and direction, stop 4. Proceed to Step 2 Wall in front? dir     dir + 90º pos = pos0 and dir = dir0? Yes No Yes No pos    pos0 dir    dir0 pos     pos + forward Input: pos0, dir0 Stop
OOP — O bject- O riented  P rogramming ,[object Object],[object Object],[object Object]
OOP (cont’d) ,[object Object],[object Object],[object Object]
The Main OOP Concepts: ,[object Object],[object Object]
OOP Benefits ,[object Object],[object Object],[object Object]
Software Development Tools ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
The First “Bug” “ (moth) in relay” Mark II Aiken Relay Calculator (Harvard University, 1945)
Compiled Languages: Edit-Compile-Link-Run Editor Source code Compiler Object code Linker Executable program Editor Source code Compiler Object code Editor Source code Compiler Object code 
IDE — I ntegrated  D evelopment  E nvironment ,[object Object],[object Object],[object Object],[object Object]
Compiler vs.  Interpreter ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Editor Source code Interpreter 
Java’s Hybrid Approach: Compiler + Interpreter ,[object Object],[object Object],[object Object]
Java’s Compiler + Interpreter
Why Bytecodes? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Java SDK (a.k.a. JDK) — S oftware  D evelopment  K it ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],All these are command-line tools, no GUI
Java SDK (cont’d) ,[object Object],[object Object],[object Object],http://java.sun.com/j2se/1.4/docs http://www.skylit.com/javamethods/appxg.html
Java IDEs ,[object Object],[object Object],[object Object],[object Object],[object Object]
Types of Programs: ,[object Object],[object Object],[object Object]
Console Applications ,[object Object],[object Object],C:avamethodsh03>  set classpath=.;C:avamethodsasyIO C:avamethodsh03>  javac Greetings2.java C:avamethodsh03>  java Greetings2 Enter your first name:  Josephine Enter your last name:  Javadoc Hello, Josephine Javadoc Congratulations on your third program! C:avamethodsh03>  _
Greetings2.java public class Greetings2 { public static void main(String[  ] args) { EasyReader  console = new  EasyReader (); System.out.print("Enter your first name: "); String firstName = console.readLine(); System.out.print("Enter your last name: "); String lastName = console.readLine(); System.out.println("Hello, " + firstName + " " + lastName); System.out.println("Congratulations on your third program!"); } } EasyReader.class   must be in the same folder as your program (or set the  classpath  to include its location). The  EasyReader  class (written by the  Java Methods  authors) is used for getting keyboard input. Prompts
Command-Line Arguments C:avamethodsh03>  javac Greetings.java C:avamethodsh03>  java Greetings  Josephine Javadoc Hello, Josephine Javadoc public class Greetings { public static void main(String[  ] args) { String firstName =  args[ 0 ] ; String lastName =  args[ 1 ] ; System.out.println("Hello, " + firstName + "  " + lastName); } } Command-line arguments are passed to  main as an array of  String s.
Command-Line Args (cont’d) ,[object Object],[object Object],Josephine Javadoc (Or prompt for them)
GUI Applications Menus Buttons Clickable panel Slider
HelloGui.java import java.awt.*; import javax.swing.*; public class HelloGui  extends  JFrame { ... <  other code  > public static void main(String[  ] args) { HelloGui window = new HelloGui(); window.addWindowListener( new ExitButtonListener ()); window.setSize(300, 100); window.show(); } } The  ExitButtonListener  class (written by the  Java Methods  authors) is used for handling the “window close” button. ExitButtonListener.class   must be in the same folder as your program (or set the  classpath  to include its location). GUI libraries
HelloApplet.java import java.awt.*; import javax.swing.*; public class HelloApplet  extends  JApplet { public void init() { ... } ... <  other methods  > } No  main  in applets: the  init  method is called by the applet viewer or the browser
Review: ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Review (cont’d): ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

What's hot

Professional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsProfessional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsLemi Orhan Ergin
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testingHadi Fadlallah
 
Android SDK Tutorial | Edureka
Android SDK Tutorial | EdurekaAndroid SDK Tutorial | Edureka
Android SDK Tutorial | EdurekaEdureka!
 
What is software engineering
What is software engineeringWhat is software engineering
What is software engineeringJennifer Polack
 
Software Development Life Cycle (SDLC )
Software Development Life Cycle (SDLC )Software Development Life Cycle (SDLC )
Software Development Life Cycle (SDLC )eshtiyak
 
Rapid application development model
Rapid application development modelRapid application development model
Rapid application development modelVaibhav Dash
 
SDLC ITS MODEL AND SOFTWARE TESTING
SDLC ITS MODEL AND SOFTWARE TESTING SDLC ITS MODEL AND SOFTWARE TESTING
SDLC ITS MODEL AND SOFTWARE TESTING Abhinav Shukla
 
INTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGINTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGProf Ansari
 
extreme Programming
extreme Programmingextreme Programming
extreme ProgrammingBilal Shah
 
software development life cycle(SDLC)
software development life cycle(SDLC)software development life cycle(SDLC)
software development life cycle(SDLC)sanoop s
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGSaqib Raza
 
Intro to programming and how to start that career
Intro to programming and how to start that careerIntro to programming and how to start that career
Intro to programming and how to start that careerTarek Alabd
 
Software Engineering (Introduction to Software Engineering)
Software Engineering (Introduction to Software Engineering)Software Engineering (Introduction to Software Engineering)
Software Engineering (Introduction to Software Engineering)ShudipPal
 
How to start your career as a software engineer
How to start your career as a software engineer How to start your career as a software engineer
How to start your career as a software engineer Intellipaat
 
Programming languages
Programming languagesProgramming languages
Programming languagesSimon Mui
 
Reengineering pros and cons
Reengineering pros and consReengineering pros and cons
Reengineering pros and consNeema Volvoikar
 

What's hot (20)

Professional Software Development, Practices and Ethics
Professional Software Development, Practices and EthicsProfessional Software Development, Practices and Ethics
Professional Software Development, Practices and Ethics
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
 
Android SDK Tutorial | Edureka
Android SDK Tutorial | EdurekaAndroid SDK Tutorial | Edureka
Android SDK Tutorial | Edureka
 
What is software engineering
What is software engineeringWhat is software engineering
What is software engineering
 
Software Development Life Cycle (SDLC )
Software Development Life Cycle (SDLC )Software Development Life Cycle (SDLC )
Software Development Life Cycle (SDLC )
 
Rapid application development model
Rapid application development modelRapid application development model
Rapid application development model
 
SDLC ITS MODEL AND SOFTWARE TESTING
SDLC ITS MODEL AND SOFTWARE TESTING SDLC ITS MODEL AND SOFTWARE TESTING
SDLC ITS MODEL AND SOFTWARE TESTING
 
INTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERINGINTRODUCTION TO SOFTWARE ENGINEERING
INTRODUCTION TO SOFTWARE ENGINEERING
 
extreme Programming
extreme Programmingextreme Programming
extreme Programming
 
software development life cycle(SDLC)
software development life cycle(SDLC)software development life cycle(SDLC)
software development life cycle(SDLC)
 
REQUIREMENT ENGINEERING
REQUIREMENT ENGINEERINGREQUIREMENT ENGINEERING
REQUIREMENT ENGINEERING
 
Intro to programming and how to start that career
Intro to programming and how to start that careerIntro to programming and how to start that career
Intro to programming and how to start that career
 
Software Engineering (Introduction to Software Engineering)
Software Engineering (Introduction to Software Engineering)Software Engineering (Introduction to Software Engineering)
Software Engineering (Introduction to Software Engineering)
 
How to start your career as a software engineer
How to start your career as a software engineer How to start your career as a software engineer
How to start your career as a software engineer
 
Sdlc models
Sdlc modelsSdlc models
Sdlc models
 
An introduction to software engineering
An introduction to software engineeringAn introduction to software engineering
An introduction to software engineering
 
Waterfall Model
Waterfall ModelWaterfall Model
Waterfall Model
 
Software Engineering II
Software Engineering IISoftware Engineering II
Software Engineering II
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Reengineering pros and cons
Reengineering pros and consReengineering pros and cons
Reengineering pros and cons
 

Viewers also liked

Software (Application and System Software)
Software (Application and System Software)Software (Application and System Software)
Software (Application and System Software)Project Student
 
Requirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRequirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRupesh Vaishnav
 
Lecture 15 requirements modeling - scenario, information and analysis class...
Lecture 15   requirements modeling - scenario, information and analysis class...Lecture 15   requirements modeling - scenario, information and analysis class...
Lecture 15 requirements modeling - scenario, information and analysis class...IIUI
 
SE_Lec 00_ Software Engineering 1
SE_Lec 00_ Software Engineering 1SE_Lec 00_ Software Engineering 1
SE_Lec 00_ Software Engineering 1Amr E. Mohamed
 
Lecture 16 requirements modeling - scenario, information and analysis classes
Lecture 16   requirements modeling - scenario, information and analysis classesLecture 16   requirements modeling - scenario, information and analysis classes
Lecture 16 requirements modeling - scenario, information and analysis classesIIUI
 
Lecture 17 design concepts (2)
Lecture 17   design concepts (2)Lecture 17   design concepts (2)
Lecture 17 design concepts (2)IIUI
 
Introduction to Software Engineering 1
Introduction to Software Engineering 1Introduction to Software Engineering 1
Introduction to Software Engineering 1IIUI
 
Chapter 08 secondary storage
Chapter 08 secondary storageChapter 08 secondary storage
Chapter 08 secondary storageIIUI
 
Software engineering : Layered Architecture
Software engineering : Layered ArchitectureSoftware engineering : Layered Architecture
Software engineering : Layered ArchitectureMuhammed Afsal Villan
 
Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)IIUI
 
Chapter 04 computer codes
Chapter 04 computer codesChapter 04 computer codes
Chapter 04 computer codesIIUI
 
Lecture 20 software testing (2)
Lecture 20   software testing (2)Lecture 20   software testing (2)
Lecture 20 software testing (2)IIUI
 
Lecture 14 requirements modeling - flow and behavior
Lecture 14   requirements modeling - flow and  behaviorLecture 14   requirements modeling - flow and  behavior
Lecture 14 requirements modeling - flow and behaviorIIUI
 
Chapter 09 io devices
Chapter 09 io devicesChapter 09 io devices
Chapter 09 io devicesIIUI
 
Lecture 2 introduction to Software Engineering 1
Lecture 2   introduction to Software Engineering 1Lecture 2   introduction to Software Engineering 1
Lecture 2 introduction to Software Engineering 1IIUI
 

Viewers also liked (18)

Software (Application and System Software)
Software (Application and System Software)Software (Application and System Software)
Software (Application and System Software)
 
Hardware and Software
Hardware and SoftwareHardware and Software
Hardware and Software
 
Requirement analysis and specification, software engineering
Requirement analysis and specification, software engineeringRequirement analysis and specification, software engineering
Requirement analysis and specification, software engineering
 
Lecture 15 requirements modeling - scenario, information and analysis class...
Lecture 15   requirements modeling - scenario, information and analysis class...Lecture 15   requirements modeling - scenario, information and analysis class...
Lecture 15 requirements modeling - scenario, information and analysis class...
 
SE_Lec 00_ Software Engineering 1
SE_Lec 00_ Software Engineering 1SE_Lec 00_ Software Engineering 1
SE_Lec 00_ Software Engineering 1
 
Lecture 16 requirements modeling - scenario, information and analysis classes
Lecture 16   requirements modeling - scenario, information and analysis classesLecture 16   requirements modeling - scenario, information and analysis classes
Lecture 16 requirements modeling - scenario, information and analysis classes
 
Lecture 17 design concepts (2)
Lecture 17   design concepts (2)Lecture 17   design concepts (2)
Lecture 17 design concepts (2)
 
Introduction to Software Engineering 1
Introduction to Software Engineering 1Introduction to Software Engineering 1
Introduction to Software Engineering 1
 
Chapter 08 secondary storage
Chapter 08 secondary storageChapter 08 secondary storage
Chapter 08 secondary storage
 
Software engineering : Layered Architecture
Software engineering : Layered ArchitectureSoftware engineering : Layered Architecture
Software engineering : Layered Architecture
 
Lecture 13 requirements modeling - flow & behavior (2)
Lecture 13   requirements modeling - flow &  behavior (2)Lecture 13   requirements modeling - flow &  behavior (2)
Lecture 13 requirements modeling - flow & behavior (2)
 
Chapter 04 computer codes
Chapter 04 computer codesChapter 04 computer codes
Chapter 04 computer codes
 
Lecture 20 software testing (2)
Lecture 20   software testing (2)Lecture 20   software testing (2)
Lecture 20 software testing (2)
 
Lecture 14 requirements modeling - flow and behavior
Lecture 14   requirements modeling - flow and  behaviorLecture 14   requirements modeling - flow and  behavior
Lecture 14 requirements modeling - flow and behavior
 
Chapter 09 io devices
Chapter 09 io devicesChapter 09 io devices
Chapter 09 io devices
 
Lect3 ch15-unit2
Lect3 ch15-unit2Lect3 ch15-unit2
Lect3 ch15-unit2
 
Lecture 2 introduction to Software Engineering 1
Lecture 2   introduction to Software Engineering 1Lecture 2   introduction to Software Engineering 1
Lecture 2 introduction to Software Engineering 1
 
Layered Software Architecture
Layered Software ArchitectureLayered Software Architecture
Layered Software Architecture
 

Similar to Introduction Java Methods OOP Software Development Process

Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1sotlsoc
 
Introducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaIntroducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaFacultad de Ciencias y Sistemas
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to JavaDevaKumari Vijay
 
1 2 java development
1 2 java development1 2 java development
1 2 java developmentKen Kretsch
 
R:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java developmentR:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java developmentKen Kretsch
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Mikkel Flindt Heisterberg
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Pratima Parida
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for DesignersR. Sosa
 

Similar to Introduction Java Methods OOP Software Development Process (20)

Srgoc java
Srgoc javaSrgoc java
Srgoc java
 
Javalecture 1
Javalecture 1Javalecture 1
Javalecture 1
 
Chapter 2.1
Chapter 2.1Chapter 2.1
Chapter 2.1
 
Introducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con JavaIntroducción a la progrogramación orientada a objetos con Java
Introducción a la progrogramación orientada a objetos con Java
 
1.introduction to java
1.introduction to java1.introduction to java
1.introduction to java
 
OOP-Chap2.docx
OOP-Chap2.docxOOP-Chap2.docx
OOP-Chap2.docx
 
Curso de Programación Java Básico
Curso de Programación Java BásicoCurso de Programación Java Básico
Curso de Programación Java Básico
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
 
1 2 java development
1 2 java development1 2 java development
1 2 java development
 
R:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java developmentR:\ap java\class slides\chapter 1\1 2 java development
R:\ap java\class slides\chapter 1\1 2 java development
 
00 intro to java
00 intro to java00 intro to java
00 intro to java
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
1- java
1- java1- java
1- java
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)Java Semimar Slide (Cetpa)
Java Semimar Slide (Cetpa)
 
Basic java part_ii
Basic java part_iiBasic java part_ii
Basic java part_ii
 
Programming
ProgrammingProgramming
Programming
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Java 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENTJava 3 rd sem. 2012 aug.ASSIGNMENT
Java 3 rd sem. 2012 aug.ASSIGNMENT
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Introduction Java Methods OOP Software Development Process

  • 1. An Introduction to Software Development Java Methods An Introduction to Object-Oriented Programming Maria Litvin Gary Litvin Copyright © 2003 by Maria Litvin, Gary Litvin, and Skylight Publishing. All rights reserved . TM ch  3
  • 2.
  • 4.
  • 5.
  • 6. Programming Languages 1940 1950 1960 1970 1980 1990 2000 Machine code Assembly languages Fortran Basic Pascal Scheme C C++ Java LISP Smalltalk Smalltalk-80 C# Logo
  • 7.
  • 8.
  • 9. Pseudocode and Flowcharts 1. Start at pos0, facing dir0 2. If wall in front, turn 90º clockwise else go forward 3. If back to initial position and direction, stop 4. Proceed to Step 2 Wall in front? dir  dir + 90º pos = pos0 and dir = dir0? Yes No Yes No pos  pos0 dir  dir0 pos  pos + forward Input: pos0, dir0 Stop
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15. The First “Bug” “ (moth) in relay” Mark II Aiken Relay Calculator (Harvard University, 1945)
  • 16. Compiled Languages: Edit-Compile-Link-Run Editor Source code Compiler Object code Linker Executable program Editor Source code Compiler Object code Editor Source code Compiler Object code 
  • 17.
  • 18.
  • 19.
  • 20. Java’s Compiler + Interpreter
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27. Greetings2.java public class Greetings2 { public static void main(String[ ] args) { EasyReader console = new EasyReader (); System.out.print(&quot;Enter your first name: &quot;); String firstName = console.readLine(); System.out.print(&quot;Enter your last name: &quot;); String lastName = console.readLine(); System.out.println(&quot;Hello, &quot; + firstName + &quot; &quot; + lastName); System.out.println(&quot;Congratulations on your third program!&quot;); } } EasyReader.class must be in the same folder as your program (or set the classpath to include its location). The EasyReader class (written by the Java Methods authors) is used for getting keyboard input. Prompts
  • 28. Command-Line Arguments C:avamethodsh03> javac Greetings.java C:avamethodsh03> java Greetings Josephine Javadoc Hello, Josephine Javadoc public class Greetings { public static void main(String[ ] args) { String firstName = args[ 0 ] ; String lastName = args[ 1 ] ; System.out.println(&quot;Hello, &quot; + firstName + &quot; &quot; + lastName); } } Command-line arguments are passed to main as an array of String s.
  • 29.
  • 30. GUI Applications Menus Buttons Clickable panel Slider
  • 31. HelloGui.java import java.awt.*; import javax.swing.*; public class HelloGui extends JFrame { ... < other code > public static void main(String[ ] args) { HelloGui window = new HelloGui(); window.addWindowListener( new ExitButtonListener ()); window.setSize(300, 100); window.show(); } } The ExitButtonListener class (written by the Java Methods authors) is used for handling the “window close” button. ExitButtonListener.class must be in the same folder as your program (or set the classpath to include its location). GUI libraries
  • 32. HelloApplet.java import java.awt.*; import javax.swing.*; public class HelloApplet extends JApplet { public void init() { ... } ... < other methods > } No main in applets: the init method is called by the applet viewer or the browser
  • 33.
  • 34.

Editor's Notes

  1. This chapter gives a glimpse of how software development evolved from artisanship into a professional engineering discipline. At the same time, students will get familiar with Java development tools and run their first programs.
  2. Students with a penchant for history can find a lot of interesting historical data on programming languages and software methodologies on the Internet. Those who are more interested in algorithms may be intrigued by recursion and may try to come up with recursive versions of common algorithms.
  3. A Google search for SOFTWARE results in over 80 million hits. Computers run everything from power grids, water utilities, TV satellites, and telephone networks to cars and coffee makers. Try to envision our lives if all programs were suddenly wiped out. Also try to appreciate the total effort that was needed to develop this invisible universe.
  4. The idea of developing intelligent computers (AI, or artificial intelligence) came about as soon (or perhaps before) as the first computer. Over the years the expectations turned out to be too optimistic. Little progress to report so far.
  5. The main premise of the current software development culture is that hardware keeps getting faster and cheaper, so efficiency is no longer an issue. As a result, the performance of some programs even on fast computers may be rather sluggish, and we are forced to upgrade our computers every couple of years. This arrangement is good for both hardware and software companies: new computers have room for new software, bigger and slower software calls for new computers. This disregard for efficiency and economy in commercial software may be partly intentional.
  6. Thousands of programming languages and dialects have been described; many evolved over the years, others have disappeared, some existed for years but recently gained new popularity (e.g., Perl, Python). Java was initially meant for embedded systems (like home appliances) and for “interactive TV” but has survived due to the Internet. Machine code is called “first generation”; assembly languages are second generation; “high-level languages” (Fortran, Basic, Pascal, Smalltalk, etc.) are third generation. Fourth generation — visual prototyping systems with automatic code generation — was a buzzword in the 1980s (in the field called CASE, Computer-Aided Software Engineering), but the promise never really materialized.
  7. This is the time to play the “I’m thinking of a number from one to one hundred” game. Other simple algorithms (e.g., bubble sort) can be staged with students. Students should be encouraged to come up with their own examples of “interesting” algorithms.
  8. Iterations and recursion make an algorithm different from a cookbook recipe. In most cookbook instructions, each step is performed once. This works because the chef is slow. But a computer is very fast, billions of times faster than a programmer. If we had to write out separately every instruction that a computer executes, we wouldn’t be able to take advantage of its speed. In non-trivial algorithms, the same sequences of steps are repeated multiple times (but the values of variables are updated at each step).
  9. Flowcharts are pretty much history: they are really not used in software development any more since programming has switched to OOP. One should specify when a given algorithm applies (preconditions) and its final state (postconditions). What are the preconditions here? The room is rectangular; the robot is placed next to a wall. What if the preconditions aren’t satisfied? Infinite loop, the program “hangs.”
  10. “ Methods” in Java are like functions in C or C++. Calling an object’s method is often phrased as “sending a message” to the object.
  11. In the previous example, the program may have a class Robot and an object of that class. A Robot object keeps in its memory its initial and current position. A robot has methods to step forward and to turn. Another class may be Position; the initial and current positions may be objects of that class. Robot’s methods “forward” and “turn” may call Position’s methods “move” and “turn.” The number of classes in a project may be quite large, but they are usually short. In Java each class is stored in a separate file. (An exception are the so-called inner classes that are embedded inside another class. They are not discussed in this book.) The name of the file must be exactly the same as the name of the class (including upper and lower case) with the extension .java .
  12. Event-driven applications are necessitated by GUI: the program cannot predict which button or menu the user will click next; it reacts to different events as they come. The robot program may have a step button, for instance. Inheritance allows you to reuse most of the code in a class and redefine or add a couple of things. We could extend Robot into a JumpingRobot, adding a method “jump.” These concepts will become clearer in the next chapter and in the subsequent chapters.
  13. At least these are the claims. OOP is definitely good for GUI development. But is it universally applicable in any type of project? OOP originated in academia; in a rather unique situation, businesses have spent millions of dollars converting to OOP and retraining their programmers without serious formal cost-benefit analysis. Prior to OOP the big thing was structured programming and top-down development .
  14. A programming language has a strict syntax. A compiler parses the source code and checks the syntax. There are other programming tools. “Make” keeps track of the project and the time marks on files and recompiles only those files whose source code has changed. Version control software allows a team of programmers to keep track of changes to files, so that two programmers are not working with the same file at the same time.
  15. This is a neat legend, but actually the term “bug” was used earlier.
  16. If you read your code carefully and reason about it before compiling, the number of cycles through Edit-Compile-Link-Run will be reduced, perhaps even to one!
  17. An IDE is especially helpful in Java because a project may have a large number of source files (each class is in a separate file).
  18. A Java interpreter is built into a Java-enabled browser for running applets. Due to a legal dispute between Sun and Microsoft, Internet Explorer does not have the latest version of Java built in, but Sun provides a Java “plug-in” for it. Netscape 6.0 has the latest version of Java.
  19. Java Virtual Machine is an imaginary computer with a CPU instruction set that is “the least common denominator” for typical real CPUs.
  20. There is also JIT (Just In Time) compiler technology where the program is interpreted and compiled at the same time. On subsequent runs the compiled code is used; there is no need to reinterpret it.
  21. Java’s culture is pretty open, and many applets are available on the Internet with their source code. Still, software vendors may want to protect their source code. For obvious reasons, the interpreter wouldn’t allow an applet to read or write files on your computer. Hackers have peculiar ethics (or rather, a gap in ethics): they won’t go around checking locks on the doors of houses or cars or spread real disease germs (even if nonlethal ones), but they will break into your computer system (which may be much more harmful and expensive) and spread computer viruses.
  22. SDK lacks an editor, so we use non-SDK software to create the source code. Our main tools are javac, java, and appletviewer. IDE usually has a more convenient debugger than SDK’s debugger. We recommend not using a debugger at all.
  23. It may be better to download Java docs together with the SDK and install them on the school server.
  24. Most Java IDEs are written in Java. JCreator is an exception: it is written in C++ and is a little more compact and faster. It requires that SDK be installed. If an IDE does not come with an SDK, then install the SDK first, before the IDE.
  25. Console applications emulate a teletype device; they are sometimes called terminal applications (comes from old text-only terminals).
  26. Console applications may be not much fun, but they do the job when you need to test a simple calculation or algorithm. Classpath is explained at skylit.com/javamethods/faqs.html . C:\\javamethods\\EasyIO presumably holds EasyReader.class (see the next slide).
  27. We supplied EasyReader and EasyWriter because native Java IO classes are quite confusing and rather hard to use.
  28. Command-line arguments are not specific to Java: C and C++ have them, as well as other languages under Unix, DOS, etc. In Windows, use the Command Prompt application. There’s no command-line mode on a Mac. The Java source file name is a command line argument for javac. Likewise, the HTML file name is a command-line argument for appletviewer.
  29. An IDE usually provides a way to set command-line args (on a Mac, too) or prompts for them when you run your program.
  30. This screen is from the Marine Biology Simulation case study, developed by Alyce Brady for the College Board and used on the AP CS exams.
  31. JFrame is a Swing library class for a generic program window. The ExitButtonListener class is tiny and its code could be written “inline” in the program itself, but we didn’t want to clutter the program with cryptic code and syntax. In a GUI program the program itself defines the initial dimensions of the program window. In an applet, the dimensions are defined in the &lt;applet&gt; tag in the HTML file.
  32. Like JFrame , JApplet is also a Swing library class — but for an applet. We redefine its init method.
  33. What are some of the current software development concerns? Team development, reusability, easier maintenance, portability, user-friendliness. What is OOP? Object-Oriented Programming — a program simulates a world of active objects. Define inheritance. Inheritance is when one class (a subclass) extends another class (the superclass), adding new features and/or redefining some of the features. What are editor, compiler, linker, debugger used for? Creating source code (program text); compiling source into object code (CPU instructions); combining object module(s) and libraries into an executable program; running a program in a controlled manner and correcting bugs, respectively. Define IDE. Integrated Development Environment — combines software development tools under one GUI. How is a compiler different from an interpreter? A compiler creates object modules that can be linked into an executable. The compiler is not needed to run the executable. An interpreter interprets the source and executes appropriate instructions. It must be installed and active to execute program statements.
  34. Name some benefits of Java’s compiler + interpreter approach. Bytecodes are device-independent, load faster, allow for security checks, and don’t reveal source code. What is a console application? An application in the style of the old teletype or terminal (console): uses a dialog with text prompts and user input. What are command-line arguments? An array of strings passed to the program from the operating system command line that runs the program (or from a special option box in an IDE). What is a GUI application? An application with a graphical user interface, often used with a mouse or another pointing device. What is the difference between a GUI application and an applet? An application runs on the computer where it is installed. An applet is embedded in a web page and is usually downloaded from the Internet (or a local network) together with the HTML document. Where does the EasyReader class come from? What does it do? It comes from Maria and Gary Litvin with the Java Methods book. It simplifies console input and reading files.