Implementation using JAVA - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Implementation using JAVA

Description:

Title: Semiotic Oriented Autonomous Intelligent Systems Software Engineering Author: Capit o Gancho Last modified by: Ricardo Ribeiro Gudwin Created Date – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 19
Provided by: Capi69
Category:

less

Transcript and Presenter's Notes

Title: Implementation using JAVA


1
Implementation using JAVA
  • DCA-FEEC-UNICAMP

Ricardo Gudwin
2
From Design to Implementation
  • Design Phase
  • development of a logical solution to the problem
  • Implementation Phase
  • start the process of program construction
  • Main Implementation Steps
  • Constructive Design
  • Coding
  • Testing
  • Documenting
  • Main Results
  • Constructive Design Documentation
  • Program Code
  • Program Manual

3
From Design to Implementation
  • Constructive Design
  • Object reuse
  • from older projects
  • from development tools APIs and frameworks
  • Based on the selected encoding language and
    development tool
  • Follows the same basic principles from design
    phase
  • Constructive Design Documentation
  • Based on design documentation
  • Interaction Diagrams
  • Software Class Diagrams
  • Details the parts of diagrams including reused
    objects and classes
  • Contracts are substituted by Method code

4
Constructive Design
  • Some care with the Constructive Design Diagrams
  • Software Class Diagram
  • Set of Navigability in associations
  • Set of Role Names in associations
  • Set of Multiplicity in associations
  • Extraction of unnecessary associations
  • Interaction Diagram
  • Use of extended message notation, when required
  • Decomposition to avoid bloated diagrams
  • Condition to start Constructive Design
  • understanding the objects/classes available from
    the development tool/language APIs and
    frameworks
  • mixing reused objects and new objects in a
    consistent way

5
Java APIs and Frameworks
  • Java Frameworks
  • Java Applet Framework - basics for Java applets
  • Java Commerce Framework - secure monetary
    transactions
  • Java Enterprise Framework - object and
    database-access services for distributed systems
    (includes CORBA)
  • Java Server Framework - development of servers
  • Java Media Framework - graphics, video, audio and
    animation
  • Java Security Framework - authentication, digital
    signatures, encryption
  • Java Beans Framework - Java native component
    model
  • Objects are distributed within packages
  • imported to source code using the import
    instruction

6
Java Platform Packages
7
Java Platform Packages
8
Java Foundation Classes
  • Java Foundation Classes (JFC)
  • AWT
  • Abstract Window Toolkit
  • Java 2D
  • Java 2D is a graphics API based on technology
    licensed from IBM/Taligent
  • Accessibility
  • provides assistive technologies, like screen
    magnifiers, for use with the various pieces of
    JFC
  • Drag and Drop
  • part of the next JavaBean generation, "Glasgow,"
    also available with the Java 2 platform.
  • Swing
  • set of well-groomed widgets and a framework to
    specify how GUIs are visually
    presented, independent of platform.

9
Swing
  • Swing widgets
  • simply extend AWT by adding a new set of
    components, the JComponents, and
    a group of related support classes.
  • are all JavaBeans and participate in the
    JavaBeans event model.
  • Subset of Swing widgets
  • analogous to the basic AWT widgets.
  • lightweight components
  • Lightweight component architecture
  • introduced in AWT 1.1.
  • allows components to exist without native
    operating system widgets
  • participate in the Model/View/Controller (MVC)
    architecture
  • New widgets
  • trees, tabbed panes, and splitter panes

10
Swing Widgets
11
Creating and Managing Windows
  • Panels
  • JPanel - The basic container
  • Layout Manager
  • Organizes widgets within a container
  • BorderLayout, GridLayout, FlowLayout, etc
  • The Main Window
  • JFrame - a window with decorations
  • has content panel - JPanel
  • Events and Listeners
  • Application listeners implement standard listener
    interfaces, based on the desired events
  • are further added to the desired component

12
Creating and Managing Windows
13
Drawing on a Window
  • All JComponent (including JPanels) can be drawn
    over
  • overriding the method paint
  • public void paint(Graphics g)
  • The Graphics object
  • provide a full set of methods for drawing,
    filling, etc.
  • Graphics2D
  • extends the Graphics class to provide more
    sophisticated control over geometry,coordinate
    transformations, color management, and text
    layout
  • fundamental class for rendering 2-dimensional
    shapes, text and images
  • public void paint(Graphics g) Graphics2D g2
    (Graphics2D) g

14
Basics on Java
  • The starting object
  • implements the method main
  • public static void main(String args)
  • callable from the o.s. environment
  • Exceptions
  • the try-catch/throws mechanism
  • Special objects
  • super and this
  • Inner Classes
  • used to derive specialized listeners and adapters
  • Interfaces, Classes and Abstract Classes

15
Basics on Java
  • Listeners and Adapters
  • Listener - interface (need to be implemented)
  • Adapter - basic class implementing a listener
    (need to be extended)
  • Class Modifiers
  • public, abstract, final
  • Field Modifiers
  • static, final, transient, volatile
  • Method Modifiers
  • public, protected, private, abstract, static,
    final, synchronized, native
  • Special statements
  • throw, synchronized

16
Basics on Java
  • Thread Programming
  • The Java Virtual Machine allows an application to
    have multiple threads of execution running
    concurrently
  • Priorities
  • Daemons and Non-Daemons Threads
  • Two ways to create a new thread of execution
  • declare a class to be a subclass of Thread
  • override the run method of class Thread
  • instance of the subclass can then be allocated
    and started by calling its method start
  • declare a class that implements the Runnable
    interface
  • implements the run method
  • instance of the class can then be allocated and
    passed as an argument when creating a Thread
    object that is further started

17
Converting Diagrams to Code
18
Converting Diagrams to Code
Write a Comment
User Comments (0)
About PowerShow.com