[part1] welcome to the java world

45
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | object oriented distributed computing secure frameworks garbage collection cross-platform simple robust high performance dynamic virtual machine portable Welcome To the Java World! Java 세상에 오신 것을 환영합니다! Part 1: - Course Objectives - What is Java? 임종대 Oracle [email protected] Oracle Confidential – Highly Restricted

Upload: jongdae-lim

Post on 16-Jul-2015

63 views

Category:

Software


4 download

TRANSCRIPT

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

object oriented distributed computing

secure

frameworks garbage collection

cross-platform simple

robust

high performance

dynamic

virtual machine

portable

Welcome To the Java World! Java 세상에 오신 것을 환영합니다!

Part 1: - Course Objectives - What is Java?

임종대 Oracle [email protected]

Oracle Confidential – Highly Restricted

1

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 2

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 3

I’m a Java guy.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 4

Course Objectives 수업 목표

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Course Objectives

Oracle Confidential – Highly Restricted 5

To be a Java guy.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Course Objectives

1. Understand fundamentals of programming such as variables, conditional and iterative execution, methods, etc.

2. Understand fundamentals of object-oriented programming in Java, including defining classes, invoking methods, using class libraries, etc.

3. Be aware of the important topics and principles of software development.

4. Have the ability to write a computer program to solve specified problems.

5. Be able to use the Java SDK environment to create, debug and run simple Java programs.

Oracle Confidential – Highly Restricted 6

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

수업 목표

1. 변수, 조건문, 반복문, 메서드 등과 같은 프로그래밍의 기초를 이해한다.

2. 클래스 정의, 메서드 실행, 클래스 라이브러리 사용하기 등을 포함하는 Java의 객체지행 프로그래밍 기초를 이해한다.

3. 소프트웨어 개발에 있어 중요한 주제와 원칙들을 이해한다.

4. 특정 문제를 해결하는 컴퓨터 프로그램 작성 능력을 기른다.

5. 간단한 Java 프로그램을 개발 및 디버깅하고 실행하기 위한 Java SDK 환경을 사용할 수 있다.

Oracle Confidential – Highly Restricted 7

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

One More Thing = English Study

Oracle Confidential – Highly Restricted 8

Because..

Java API Specification이 영어입니다.

정확한 용어를 사용해야 합니다.

좋은 원서들을 읽어야 합니다.

전세계의 뛰어난 엔지니어들의 도움을 받을 수 있습니다.

GIMF! = Google Is My Friend!

오픈소스(Open Source) = Contribution!

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 9

IT (Information Technology) 아이티

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

IT(Information Technology) 회사들..

Oracle Confidential – Highly Restricted 10

SI (System Integration)

• Samsung SDS • LG CNS • SK C&C • …

시스템 통합, 컨설팅, 프로젝트 수행

Startups (Ventures)

혁신적 기술과 아이디어를 보유한 설립된 지 얼마 되지 않은 창업기업

Vendors

외국계 또는 국내 S/W, H/W 공급자

• Oracle • IBM • MS • Amazon • …

Consulting Firm

• McKinsey • Accenture • Deloitte • PWC • OpenTide • …

Business 및 IT에 대한 컨설팅 수행

Game

Partners

특정 S/W, H/W의 전략적 기술 파트너

Customers (고객)

사용자, 제조, 금융, 공공, 서비스 등

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

IT(Information Technology) 직업들..

• Programmer(=coder?) : 프로그래머(프로그램을 제작하는 사람)

• SE : System/Software Engineer, 엔지니어

• Consultant : 컨설턴트(IT 지식을 컨설팅 하는 사람)

• Architect : 아키텍트(S/W, 시스템, 네트워크 등의 설계자)

• PM : Project Manager(프로젝트 관리자), Product Manager(제품 관리자)

• PL : Project Leader, 프로젝트 내부 팀장(Senior Architect, DBA 등이 담당)

• DBA : Database Administrator(데이터베이스 관리자)

• Designer : UI/UX를 담당하는 디자이너

• QA : Quality Assurance(소프트웨어의 품질 관리 담당자)

• …

Oracle Confidential – Highly Restricted 11

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Course Objectives

Oracle Confidential – Highly Restricted 12

To be familiar with Terms & Abbreviations.

용어와 약자에 익숙해지자.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Want to be a programmer? 프로그래머가 되고 싶으신가요?

Oracle Confidential – Highly Restricted 13

vs.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 14

What is Program? 프로그램은 무엇인가요?

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

프로그램의 종류

Oracle Confidential – Highly Restricted 15

Mobile Apps 모바일 앱

Desktop Applications 데스크탑(PC) 애플케이션

Smart Device Apps 스마트 기기 앱

network

network network

애플리케이션은 혼자서 동작하거나, 네크워크를 통해 인터넷에 연결되어 있다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Terminology 용어정의

Oracle Confidential – Highly Restricted 16

Software (소프트웨어, SW, S/W) 특정한 목적의 하나 또는 다수의 컴퓨터 프로그램 하드웨어(Hardware, HW, H/W)의 반대의미

Program (프로그램) 컴퓨터에 의해 실행되는 지시사항의 모음인 컴퓨터

소프트웨어 프로그램은 프로그래밍된 결과물을 뜻하고,

소프트웨어는 하드웨어의 반대 개념으로서의 의미이지만, 일반적으로는 같은 의미

Application (애플리케이션, Apps, 앱, 어플) 넓은 의미에서는 운영체제(OS)에서 실행되는 모든

소프트웨어를 말함 좁은 의미에서는 OS 위에서 사용자가 직접 사용하게되는

소프트웨어

“PC에 소프트웨어들 설치했어?” “개발자라면 MS Office 같은 소프트에워는 정품 구매해야지!”

“난 Java로 프로그램 짤 수 있다!” “Java 개발을 위해 설치해야할 프로그램(=소프트웨어)은 어떤 것들이 있나요?”

“아이폰에 앱(=어플) 깔아봤어?” “이번 학기에는 Java로 웹 애플리케이션을 제작하는 걸 배우고 있어.”

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

표준 컴퓨터의 구조

Oracle Confidential – Highly Restricted 17

I/O Device(입출력 장치)

OS(Operating System, 오에스) Hardware(하드웨어)

메인보드

HDD CPU Memory

현재 거의 모든 컴퓨터들은 1945년 발표된 폰 노이만 (John Louis von Neumann)의 구조를 따르고 있다

응용 프로그램 즉, 애플리케이션은 OS 상에서 동작한다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

애플리케이션의 실행 과정

Oracle Confidential – Highly Restricted 18

Hello World !

Source Code(소스코드)

01010101010 01010101010 01010101010 …

Executable File(실행파일)

Compile (컴파일)

실행결과

Instruction Set(인스트럭션 세트)

예) .exe

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Server Program = 3 Tier or N Tier 서버 프로그램

Oracle Confidential – Highly Restricted 19

Client Tier 클라이언트 티어(단)

Web/App Tier 웹/애플리케이션 티어

Database Tier 웹/애플리케이션 티어

화면(UI/UX) 없이 동작하는 프로그램도 있다. 서버 프로그램은 대형 컴퓨터인 서버상에서 실행된다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Terminology 용어정의

Oracle Confidential – Highly Restricted 20

Network (네트워크, 컴퓨터망) 분산되어 있는 컴퓨터를 통신망으로 연결한 것 유/무선 네트워크(WiFi, LAN), 인터넷 등

Internet (인터넷) 컴퓨터로 연결하여 TCP/IP(Transmission Control

Protocol/Internet Protocol)라는 통신 프로토콜을 이용해 정보를 주고받는 컴퓨터 네트워크

인터넷은 "정보의 바다"라고 불리면서 컴퓨터가 서버와 클라이언트로써 서로 연결

WWW(World Wide Web, W3, 웹, 월드와이드웹) 인터넷에 연결된 컴퓨터들을 통해 사람들이 정보를

공유할 수 있는 전 세계적인 정보 공간 웹은 전자 메일과 같이 인터넷 상에서 동작하는 하나의

서비스

“여기 무선 네트워크 되나요?” “이 버튼을 누르면 네트워크를 통해 정보가 전송된다”

“이 컴퓨터 인터넷에 연결 되어 있나요?” “네크워크 선을 꽂아도 인터넷 연결이 안되요!”

“웹 브라우저 실행하고 인터넷 접속해봐.” “웹 애프리케이션을 만들려면 Java 랑 HTML을 알아야 한데.”

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

초연결 사회의 시작 (IoT, 사물인터넷) - Hyper-connected Society is coming

Connected Things > People

We are here!

21

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 22

History of Internet of Things : ~ 1990

1832

전신기의 발명 (Electromagnetic Telegraph) by Paul Schilling in Russia

1844

사무엘 모스(Samuel Morse) 최초의 모스 코드 전송 "What hath God wrought?" from Washington, D.C. to Baltimore.

1926

니콜라스 테슬라(Nikola Tesla )의 Colliers 잡지 인터뷰: "When wireless is perfectly applied the whole earth will be converted into a huge brain, which in fact it is, all things being particles of a real and rhythmic whole. … We shall be able to communicate with one another instantly, irrespective of distance. … A man will be able to carry one in his vest pocket."

1974

1969

TCP/IP 개발

ARPANET 개발 세계 최초의 패킷 스위칭 네트워크로 현재의 인터넷의 원형

Domain Name System (DNS)의 시작

1984

1989

WWW(World Wide Web )의 시작 by Tim Berners-Lee(TimBL)

1876

전화기 by Bell, Gray

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 23

History of Internet of Things : 1990 ~

1990

최초의 인터넷 디바이스 '89 INTEROP 컨퍼런스에서 John Romkey는 TCP/IP로 컴퓨터에 연결되어 원격으로 on/off 가능한 토스터기를 시연

1994

WearCam의 발명 by Steve Mann

1999

Internet of Things 용어 등장 MIT Auto-ID Center의 공동 설립자인 캐빈 애쉬턴(Kevin Ashton)은 “화장품 가게에서 립스틱을 찾지 못하는 일이 발생했는데, 이를 찾으려다 새로운 방식을 적용하게 됐다” 말함

2003

2000

최초의 인터넷 냉장고 by LG

RFID의 시대 미 국방부(US Department of Defense)와 월마트를 시작으로 다양한 분야에 RFID가 활용되기 시작함

2008 ~ 2009

IoT 시대의 시작 Connected Device > People *Source: Cisco

2011

IPv6 시작 인터넷에 연결되는 기기의 폭발적 증가를 대응

2007

iPhone 출시 by Apple

1992 최초의 스마트폰 사이먼(Simon by IBM)

1995

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 24

What is Java? Java란 무엇인가요?

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java is …

Oracle Confidential – Highly Restricted 25

an object-oriented high-level programming language 객체지향의 고급 프로그래밍 언어

인간의 언어에 매우 가까운 4세대 프로그래밍 언어

a 4GL(4th Generation Language)

썬마이크로시스템즈에 의해 개발된 머신 종속성이 없는 소프트웨어 기술

a technology developed by Sun Microsystems for machine-independent software

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

History of Java Technology

Oracle Confidential – Highly Restricted 26

James Gosling, the Father of Java

• Java 기술은 1991년 Patrick Naughton, Mike Sheridan와 James Gosling에 의해 시작된 Sun의 작은 내부 프로젝트인 Green Project에서 프로그래밍 툴로써 처음 탄생하게 되었다.

• Java 언어 자체는 Green Team 멤버였던 James Gosling에 의해 *7을 위한 프로그래밍 언어로써 만들어 졌는데, 처음 그 이름은 창밖에 보이던 나무 이름을 따 “Oak”라고 불렀다.

• 1992년, Green Team은 Java언어를 이용해 만든 터치스크린 방식 대화형 휴대용 홈 엔터테인먼트 컨트롤러 데모를 세상에 내 놓았다.

*7 ("StarSeven")

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

History of Java Technology – cont’d

Oracle Confidential – Highly Restricted 27

• 1994년, Green Team은 Java기술을 이용해 Mosaic 기반의 “Web Runner”(이후 공식적으로 HotJava가 됨)라는 최초의 동적인 컨텐츠를 보여주는 브라우저를 제작했다.

• 1995년 5월 마침내 세상에 공개된 Java는 컴퓨터 산업 역사에서 그 유래를 찾아볼 수 없을 만큼 매우 빠르게 산업 전반에 걸쳐 퍼져 나가고 있다.

Duke, Java's Mascot

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java = The Most Popular Programming Language 가장 인기있는 프로그래밍 언어

Oracle Confidential – Highly Restricted 28

출처: IEEE Spectrum All Languages Top 20, 2015

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

JDK vs. JRE JDK는 개발환경, JRE는 실행환경

Oracle Confidential – Highly Restricted 29

Java Development Kit (JDK) Java Runtime Environment

(JRE)

javac Java Virtual Machine

Standard Libraries

Other Developer Tools

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java Programming Java로 프로그래밍하기

Oracle Confidential – Highly Restricted 30

public static void main(String args[]){ System.out.println(“Hello World!”); }

> javac HelloWorld.java

> java HelloWorld

코딩 (Coding)

컴파일 (Compile)

실행 (Execute)

HelloWorld.java

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

코딩은 어떻게?

Oracle Confidential – Highly Restricted 31

•문법체크 불가 •컴파일은 개별 (커맨드창) •실행은 개별 (커맨드창) •각종 편리기능 없음 •테스트 환경 없음

•Java 개발 전용 에디터 •편리한 코딩 •자동 문법 체크 •자동 컴파일 •실행가능 (툴 내에서) •개발 편의성 제공 •테스트 환경 제공

일반 에디터 IDE(Integrated Development Envrionment)

통합 개발 환경

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Lab 0-1

Oracle Confidential – Highly Restricted 32

0. JDK 설치

1. 메모장으로 HelloWorld.java 작성

2. > javac HelloWorld.java

3. > java HelloWorld

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Lab 0-1 : Sample Answer

Oracle Confidential – Highly Restricted 33

public class HelloWorld {

public static void main(String[] args) {

System.out.println(”Hello World !” );

}

}

Hello World ! >

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 34

Java vs. Others Java의 장점과 다른 언어들과의 차이점

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java Language Benefits Java 언어의 장점

Oracle Confidential – Highly Restricted 35

• “쉬운” 언어

– 에러 처리, 멀티 쓰레드, 네트워크 프로그래밍 용이

– 포인터 연산, 메모리 관리 부하 없음

– 가볍고 유지 보수가 용이

• “순수 객체 지향” 언어

– 객체 지향 언어의 장점을 모두 수용

– 복잡성을 제거해 이해하기 쉽고 재활용성이 높음

• “안전한” 언어

– 안전한 언어로 출발 (Sandbox 모델)

– 표준화된 보안 기능 탑재 – 기본 패키지로 번들

– 언어적 위험 요소 배제

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java Language Benefits – cont’d Java 언어의 장점

Oracle Confidential – Highly Restricted 36

• “비종속적이고 동적인” 언어

– Write Once, Run Anywhere!

– 표준기반의 언어로 특정 시스템에 비종속적

– 생성된 코드는 재컴파일 없이 타시스템에서 실행 가능

– 프로그램 실행 시에 라이브러리와 연결

• “플랫폼 지원이 뛰어난” 언어

– 다양한 하드웨어 지원(Sun, Intel, IBM, HP 등 거의 모든 하드웨어)

– 다양한 운영체제 지원(Solaris, HP-UX, AIX, FreeBSD, Linux, Windows 등 거의 모든 운영체제)

• 단일 언어 습득을 통해 모든 End-to-End 솔루션 개발 가능

– 모든 플랫폼을 지원하는 언어는 Java 가 유일

– 새로운 언어 습득의 부담이 없음

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Object Oriented Language 객체 지향 언어

Oracle Confidential – Highly Restricted 37

• 객체지향 언어의 장점

– 객체지향은 우리의 사고 방식과 유사

– 의사교환이 용이한 비주얼한 모델링

– 분석과 구현의 차이가 적음

– 객체는 높은 모듈성(modularity)과 정보은닉(information hiding) 제공

– 클래스는 재사용성(reusability)과 확장성 제공

– 재사용과 확장을 통해 빠른 개발이 가능

– 인터페이스와 구현부의 분리

– 변경이 용이하여 유지보수 및 확장이 쉬움

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Hello World! in Punch Card 천공카드로 프로그래밍한 Hello World!

Oracle Confidential – Highly Restricted 38

Hello World!

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Hierarchy of Programming Language 프로그래밍 언어 계층 구조

Oracle Confidential – Highly Restricted 39

Hardware

Machine Language 기계어

Assembly Language 어셈블리 언어

High Level Language 고급 언어

자연어에 가장 가까움 단어, 숫자, 수학 기호로 구성 하드웨어가 직접 이해할 수 없음 Portable(이식성) 코드 (하드웨어와 독립) Java, C/C++, COBOL, FORTRAN, BASIC, LISP 등

0과 1로만 구성 하드웨어가 직접 이해할 수 있음 Portable하지 않음 (하드웨어에 종속)

기계어를 사람이 어느 정도 읽을 수 있게 만든 버전

단어, 약자, 문자, 숫자 등이 0과 1을 대치함

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Hello World!

Oracle Confidential – Highly Restricted 40

Hello World!

#include <stdio.h> int main() { printf("Hello, world!\n"); return 0; }

public static void main(String args[]){ System.out.println(“Hello World!”); }

#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLog (@"Hello, World!"); [pool drain]; return 0; }

000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 000400* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "Hello world!" LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT.

using System; namespace HelloWorld { class Hello { static void Main() { Console.WriteLine("Hello World!"); } }

COBOL Java

C

C#

Object C

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Write Once, Run Anywhere! 한번 쓰여진 코드는 어디에서든 실행될 수 있다!

Oracle Confidential – Highly Restricted 41

Hardware

OS

JVM

App App App

Java Virtual Machine

JVM 만 있다면 동일한 코드가 다른 하드웨어/OS 에서 실행될 수 있다. 하지만, 후에 기기의 성능 제한에 따라 스펙이 구분되었다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java vs. C/C++

Oracle Confidential – Highly Restricted 42

Java

C/C++

Java는 JVM 만 있다면 다른 플랫폼에서도 다시 컴파일 할 필요 없이 그대로 동작 합니다.

C/C++은 플랫폼의 변화에 따라 소스코드를 다시 컴파일을 해야합니다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java Platforms

Oracle Confidential – Highly Restricted 43

사용하는 언어는 동일하지만, 플랫폼에 따라 사용하는 라이브러리가 다르다 플랫폼 별로는 이식성(Portability)가 지원되지 않는다.

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Course Objectives

Oracle Confidential – Highly Restricted 44

Questions! 질문합시다!

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Highly Restricted 45

Thank you!

Jongdae Lim [email protected]