Java Web 应用开发: J2EE 和 Tomcat 蔡 剑, Ph.D.
本讲内容 信息系统实施的基本概念 面向对象的程序开发 Java 技术综述
Object Technology
What is OT?
What OT is Not?
Why OT?
Data and Function
Data, Function, Objects
Modeling and Coding
Modeling and Coding 2
Reuse
Reuse of Code
Language of Design, Analysis, and Programming
Avoid Miscommunication
Benefit Provided by Objects
Procedure Language
Object Approach
Procedure Language Example
COBOL Calling Structure
Object Calling Structure
Object Program Structure
Three OOP Principles Encapsulation: binds together code and the data it manipulates; keeps both safe from outside interference and misuse Inheritance: one object acquires the properties of another object Polymorphism: allows one interface to be used for a general class of actions
Encapsulation Public instance variables Private instance variables Private method Public method
Inheritance Automobile Car Truck Sedan SUV
Polymorphism
Unified Modeling Language Cname attr:Atype op(par:Type):Rtype class oname :Class[Role] object > association 联系 generalization 泛化 realization 实现 dependency 依赖 text notes interfacepackage actor use case 类 对象 标签 接口包 动作者 用例 (extends) (implements)
Java Language
Code Compile
Java Virtual Machine
JIT Compiler
Aims of Java