Virtual Memory, Process, and Sharing in MULTICS

Document Sample
Virtual Memory, Process, and Sharing in MULTICS Powered By Docstoc
					Object-Oriented
  Technology


     Sept. 2003
   Yin-Hsong Hsu

                   1
What to be taught in the course

   Object-Oriented Programming
       Programming J2ME
   Object-Oriented Analysis and Desingn
       Unified Modeling Language
       Unified Process
   Design Patterns
   Special Topics

                                           2
             Grading Policy

   Mid-Term (25%)
   Term Project on OOAD and J2ME (50%)
   Paper Presentation (25%)




                                          3
Why Mobile Information System?

   The wireless Web is growing quickly
       By 2003, more than a billion cellular
        subscribers are expected to create a $69
        billion marketplace
   Post-PC era
       Integration of Computer, Communications,
        and Consumer Electronics
       Information Appliances (資訊家電)

                                                   4
5
6
7
台灣資訊家電產品分項統計
                                                2000
                1999             產量     1999            產值
                        2000年產                  年產
  產品名稱           年                成      年              成長
                        量(預估)                   值(預
                產量               長率     產值               率
                                                 估)


  Thin Client   305       674    121%   91.5    190     107%


  Set-top Box   2,633    4,454   69%    650.7   909     40%


  Screen         35       49     40%    14.0     16     13%
  Phone


  SHD           442      1,550   250%   82.2    251     206%


  Total         3,415    6,765   98%    838.4   1,361   62%



  單位:千台;百萬美元            資料來源:資策會MIC IT IS計畫,2000年11月

                                                               8
      我國IA旗艦產品發展計劃
   國內有很多強勢產品發展到現在還是computer
    base,這個方向是不會改變的
   另一方面,我國mobile發展也非常快速,國內產
    業在mobile方面也較具有競爭優勢,這就是
    mobile base
   以這兩大優勢為基礎,並以application and
    service的觀點來思考,發展出低價位、產量大、
    體積小、功能齊全並含有SOC技術的產品,將可
    為台灣帶來另一波的產業發展高峰
         資料來源:三C整合策劃推行小組          9
          Related Techniques

   Hardware
   Operation System
   Networking
   User Interface
   Application Service Model
   Application Development


                                10
    Properties of Mobile Information
                 System
   Mobility
       Wireless
       Form factor
       Low power consumption
       Limited system resources
       Usability
       …


                                       11
              Must Consider

   Memory–cost driver
   Processor speed—battery life
   Display size and color–battery life
   Networking–existing wireless networks
   Form factor–consumer usability
   Subsets and options–portability of
    applications
                                            12
             What is Mobility?
   A device that moves
       Between different geographical locations
       Between different networks
   A person who moves
       Between   different   geographical locations
       Between   different   networks
       Between   different   communication devices
       Between   different   applications

                                                       13
                  Device mobility
   Plug in laptop at home/work on Ethernet
       Occasional long breaks in network access
       Wired network access only (connected => well-
        connected)
       Network address changes
       Only one type of network interface
       May want access to information when no network is
        available: hoard information locally
   Cell phone with access to cellular network
       Continuous connectivity
       Phone # remains the same (high-level network address)
       Network performance may vary from place to place


                                                            14
                People mobility
   Phone available at home or at work
       Multiple phone numbers to reach me
       Breaks in my reachability when I’m not in
   Cell phone
       Only one number to reach me
       Continuously reachable
       Sometimes poor quality and expensive
        connectivity
   Cell phone, networked PDA, etc.
       Multiple numbers/addresses for best quality
        connection
       Continuous reachability
       Best choice of address may depend on sender’s
        device or message content                       15
        Mobility means changes
How does it affect the following?
 Hardware
       Lighter
       More robust
       Lower power
   Wireless communication
       Can’t tune for stationary access
   Network protocols
       Name changes
       Delay changes
       Error rate changes
                                           16
             Changes, continued
   Fidelity
       High fidelity may not be possible
   Data consistency
       Strong consistency no longer possible
   Location/transparency awareness
       Transparency not always desirable
   Names/addresses
       Names of endpoints may change
   Security
       Lighter-weight algorithms
       Endpoint authentication harder
       Devices more vulnerable
                                                17
     Changes, continued, again
   Performance
       Network, CPU all constrained
       Delay and delay variability
   Operating systems
       New resources to track and manage: energy
   Applications
       Name changes
       Changes in connectivity
       Changes in quality of resources
   People
       Introduces new complexities, failures, devices

                                                         18
          Software Development
          Environments Changed
   Different operating systems
       Java Virtual Machine, Windows CE, Palm OS,
        Sybian, Linux, …
   Restricted system resources
   Different application models
   Different development tools
   More constraints

                                                     19
  Introduction to J2ME

         Yin-Hsong Hsu
       hsong@mcu.edu.tw
http://www.csie.mcu.edu.tw/~hs
              ong
            Ext: 3404            20
                     Java

   A simple, object-oriented, distributed,
    interpreted, robust, secure, architecture-
    neutral, portable, high performance,
    multithreaded, dynamic language -- by
    Sun




                                                 21
                 History of Java
   Green project funded by Sun for intelligent
    consumer electronic devices
   announced at May 23, 1995
   experiences from CE
       so many kinds of machines, portability
       simple
       no hard disk => network download
       security

                                                 22
Java in Nowadays




                   23
                 What Is the
        Java Programming Language?

   The Java programming language is:
       A programming language
       A development environment
       An application environment
       A deployment environment
       Similar in syntax to C++; similar in semantics to
        SmallTalk
       Used for developing both applets, servlets, midlets,
        and applications

                                                           24
       How Java Program Being
              Executed
   Application
            Source Code

                      Compile     javac prog.java

             Byte Code

                      Interpret by a virtual machine

            Interpretation
                                                       25
        The Java Virtual Machine

   JVM provides definitions for the:
       Instruction set (central processing unit [CPU])
       Register set
       Class file format
       Stack
       Garbage-collected heap
       Memory area

                                                    26
     The Java Virtual Machine

   Bytecodes that maintain proper type
    discipline from the code.
   The majority of type checking is done
    when the code is compiled.
   Every Sun approved implementation of
    the JVM must be able to run any
    compliant class file.

                                            27
Java Application Environment




       J2SE
                               28
     Java Run-Time Environment

   Performs three main tasks:
       Loads code
       Verifies code
       Executes code




                                 29
                Class Loader

   Loads all classes necessary for the
    execution of a program
   Maintains classes of the local file system in
    separate "namespaces"
   Prevents spoofing



                                               30
         Bytecode Verifier

Ensures that:
 The code adheres to the JVM specification

 The code does not violate system integrity

 The code causes no operand stack overflows
  or underflows
 The parameter types for all operational code
  are correct
 No illegal data conversions (the conversion of
  integers to pointers) have occurred
                                               31
Java 2 Platform




                  32
       How Java Program Being
              Executed
   Applet

                HTML                 Source Code

                                               compile

               Browser                Byte Code
                 with
           Virtual Machine     Load Bytecode

       JIT: Just In Time Compiler
                                                         33
     First Java Application - Hello
                 World
   Code : HelloWorldApp.java
           class HelloWorldApp {
                      public static void main(String[] args) {
                        System.out.println("Hello World!");
                      }
           }
   Compile to bytecode “HelloWorldApp.class”
   Execute the bytecode


                                                             34
          The anatomy of a Java
               application
   Comments in Java Code
       C, C++, and /** … */
   Defining a class
   The main() method
       modifiers: public static and void
       arguments to the main method
   Using classes and objects
       class variables versus instance variables

                                                    35
First Java Applet - Hello World

   Code: HelloWorld.java
      import java.applet.Applet;
      import java.awt.Graphics;

      public class HelloWorld extends Applet {
             public void paint(Graphics g) {
                     g.drawString("Hello world!", 50, 25);
             }
      }
   Compile to bytecode : HelloWorld.class
                                                             36
    The anatomy of a Java applet

   Importing classes and packages
   Defining an Applet subclass
   Implementing Applet methods




                                     37
            Running an Applet

   HTML file : xx.html
       <APPLET CODE="HelloWorld.class" WIDTH=150
    HEIGHT=25>
   The Applet tag
< applet code=class width=nn height=nn
    codebase=dir name=n align=str vspace=nn
    hspace=nn>
<param name=pn1 value=pv1>
<param name=pn2 value=pv2>
...
</applet>
                                           38
        Documentation of Java

   http://java.sun.com/j2se/1.3/docs/api/ind
    ex.html
   Down load from
    http://java.sun.com/j2se/1.3/docs.html




                                             39
J2SE Programming Environment

   Sun’s JDK (public)
       javac
       java
       Jdb
   Sun’s Forte
   Borland Jbuilder
   IBM VisualAge for Java
                             40
                    J2ME

   J2ME configurations and profiles




                                       41
J2ME configurations and profiles
   Why?
       The large range of existing device types and
        hardware configurations
       Constantly improving device technology
       The diverse range of existing applications and
        features
       The need for applications and capabilities to
        change and grow (often in unforeseen ways) in
        order to accommodate the future needs of the
        consumer.
                                                         42
J2ME layered stack




                     43
             Configuration Layer
   It defines the minimum set of Java virtual machine
    features and Java class libraries available on a
    particular “category” of devices representing a
    particular “horizontal” market segment.
   A configuration defines the “lowest common
    denominator” of the Java platform features and
    libraries that the developers can assume to be
    available on all devices.


                                                         44
   A configuration:
       specifies the Java programming language features
        supported,
       specifies the Java virtual machine features
        supported,
       specifies the basic Java libraries and APIs
        supported.


                                                           45
                    Profile Layer
   It defines the minimum set of Application
    Programming Interfaces (APIs) available on a
    particular “family” of devices representing a particular
    “vertical” market segment
   Profiles are implemented “upon” a particular
    configuration
   Applications are written “for” a particular profile and
    are thus portable to any device that “supports” that
    profile
   A device can support multiple profiles.
                                                          46
47
    Connected, Limited Device
     Configuration (CLDC)
   At least 160–192 kilobytes memory available
    for the Java platform
   Processor speed starting from 8-32 MHz
   Limited power, usually battery operation
   Connectivity to a network, often with a
    wireless, intermittent connection with limited
    bandwidth
   Market “sweet spot”:
       Smartphones, wireless e-mail devices, and
        personal communicators
                                                    48
Main differences between CLDC
    1.0 and the JVM spec.
   No floating point support in CLDC 1.0
    (CLDC 1.1 will support floating point)
   No user-defined class loaders
   No thread groups
   No reflection



                                             49
Connected Device Configuration
           (CDC)
   Has a large range of user interface capabilities
   Memory budgets in the range of 2 to 16
    megabytes
   High-bandwidth network connections, most
    often using TCP/IP
   Full Java 2 VM specification


                                                   50
          Example CDC uses
   Wireless communicators
   High-end PDAs
   TV set-top boxes
   Gateways
   Telecomm/Networking Equipment
   Industrial Controllers
   Automotive entertainment and navigation
    systems
   J2ME CDC on a chip
                                              51
52
      Mobile Information Device
            Profile (MIDP)
   for network-connectable, battery-operated
    mobile handheld devices such as cell
    phones, two-way pagers, and Palm Pilots




                                            53
54
55
Java Wireless Enterprise
Application Architecture




                           56

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:10
posted:9/15/2012
language:English
pages:56