Porting Implementation of Packet Utilization Standard from ADA to JAVA Annelie Hultman (TEC-EME) Donata Pedrazzani (TEC-EMS) ESA/ESTEC 2004 JPUS de-briefing.

Slides:



Advertisements
Similar presentations
Chapter 1 Object-Oriented Concepts. A class consists of variables called fields together with functions called methods that act on those fields.
Advertisements

Abstract Data Types Data abstraction, or abstract data types, is a programming methodology where one defines not only the data structure to be used, but.
Lecture 2: Object Oriented Programming I
ITEC200 – Week03 Inheritance and Class Hierarchies.
CPS 506 Comparative Programming Languages Abstract Data Type and Encapsulation.
Object-Oriented PHP (1)
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
Chapter 7: Inheritance Abstract Data Types Object Hierarchy Inheritance of Methods Inheritance: implicit passing of information between program components.
Abstract data types & object-oriented paradigm. Abstraction Abstraction: a view of an entity that includes only the attributes of significance in a particular.
Lecture 9 Concepts of Programming Languages
Abstract Data Types and Encapsulation Concepts
CS 106 Introduction to Computer Science I 04 / 30 / 2010 Instructor: Michael Eckmann.
1 Chapter 8 Objects and Classes. 2 Motivations After learning the preceding chapters, you are capable of solving many programming problems using selections,
Classes in C++ Bryce Boe 2012/08/15 CS32, Summer 2012 B.
OOP Languages: Java vs C++
Object Oriented Software Development
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
BPJ444: Business Programming Using Java Classes and Objects Tim McKenna
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Objects and Classes Chapter 6 CSCI CSCI 1302 – Objects and Classes2 Outline Introduction Defining Classes for Objects Constructing Objects Accessing.
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Chapter 10, Slide 1 ABSTRACT DATA TYPES Based on the fundamental concept of ABSTRACTION:  process abstraction  data abstraction Both provide:  information.
COP INTERMEDIATE JAVA Designing Classes. Class Template or blueprint for creating objects. Their definition includes the list of properties (fields)
Classes. Constructor A constructor is a special method whose purpose is to construct and initialize objects. Constructor name must be the same as the.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Object-Oriented Programming Chapter Chapter
OOP in C++ CS 124. Program Structure C++ Program: collection of files Source (.cpp) files be compiled separately to be linked into an executable Files.
Object Oriented Programming
CIS 270—Application Development II Chapter 8—Classes and Objects: A Deeper Look.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Programmeren 1 6 september 2010 HOORCOLLEGE 2: INTERACTIE EN CONDITIES PROGRAMMEREN 1 6 SEPTEMBER 2009 Software Systems - Programming - Week.
1 Chapter 11 © 1998 by Addison Wesley Longman, Inc The Concept of Abstraction - The concept of abstraction is fundamental in programming - Nearly.
1 CS Programming Languages Class 22 November 14, 2000.
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
1 Copyright © 1998 by Addison Wesley Longman, Inc. Chapter 10 Abstraction - The concept of abstraction is fundamental in programming - Nearly all programming.
ISBN Chapter 11 Abstract Data Types and Encapsulation Concepts.
Classes, Interfaces and Packages
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
POLYMORPHISM Chapter 6. Chapter Polymorphism  Polymorphism concept  Abstract classes and methods  Method overriding  Concrete sub classes and.
OOP Basics Classes & Methods (c) IDMS/SQL News
ISBN Chapter 12 Support for Object-Oriented Programming.
Lecture 9: Object and Classes Michael Hsu CSULA. 2 OO Programming Concepts Object-oriented programming (OOP) involves programming using objects. An object.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Inheritance Modern object-oriented (OO) programming languages provide 3 capabilities: encapsulation inheritance polymorphism which can improve the design,
Topic: Classes and Objects
JAVA MULTIPLE CHOICE QUESTION.
Abstract Data Types and Encapsulation Concepts
11.1 The Concept of Abstraction
Types of Programming Languages
Lecture 9 Concepts of Programming Languages
Abstract Data Types and Encapsulation Concepts
Abstract Data Types and Encapsulation Concepts
Abstract Data Types and Encapsulation Concepts
Defining Classes and Methods
Java Programming Language
11.1 The Concept of Abstraction
Lecture 9 Concepts of Programming Languages
Chapter 11 Abstraction - The concept of abstraction is fundamental in
Presentation transcript:

Porting Implementation of Packet Utilization Standard from ADA to JAVA Annelie Hultman (TEC-EME) Donata Pedrazzani (TEC-EMS) ESA/ESTEC 2004 JPUS de-briefing

05/05/2004May 04ESA/ESTEC - JPUS de-briefing2 Introduction -Final presentation of the YGT period -Ported part of the PUS Ada framework to Java -Aim of presentation -De-briefing of key findings which may be interesting for the sections

05/05/2004May 04ESA/ESTEC - JPUS de-briefing3 Outline Architecture issues -Ada packages versus Java OO -Encapsulation of data/visibility -Reusability concepts -Polymorphism Low-level operations Porting strategies -Porting of types -Porting of Ada generic package -Porting of protected objects and protected entries -Conclusion

05/05/2004May 04ESA/ESTEC - JPUS de-briefing4 Outline

05/05/2004May 04ESA/ESTEC - JPUS de-briefing5 Ada packages vs Java OO Ada  Unit of encapsulation: package Java Unit of encapsulation: class Package: repository for classes, host-environment facility which contains compiled class files

05/05/2004May 04ESA/ESTEC - JPUS de-briefing6 Encapsulation of data/visibility Ada  Physical separation between unit’s specification and body  Accessibility given by location of declaration Java No separation of a class into specification and body Access control modifiers

05/05/2004May 04ESA/ESTEC - JPUS de-briefing7 Encapsulation of data/visibility(2)

05/05/2004May 04ESA/ESTEC - JPUS de-briefing8 Reusability concepts Ada  Specification and compiled units Java javadoc documentation and bytecode (compiled.class files)

05/05/2004May 04ESA/ESTEC - JPUS de-briefing9 Polymorphism Def: ability for references and collections to hold objects of different types Ada  Explicit: use of tagged types Java Implicit from the language

05/05/2004May 04ESA/ESTEC - JPUS de-briefing10 Polymorphism in Java

05/05/2004May 04ESA/ESTEC - JPUS de-briefing11 Example: how polymorphism has been used

05/05/2004May 04ESA/ESTEC - JPUS de-briefing12 Outline

05/05/2004May 04ESA/ESTEC - JPUS de-briefing13 Low-level operations Java cannot directly control hardware: programs must declare native methods (i.e. using JNI) and implement such operations in another language Encoding/decoding to communication link in the framework

05/05/2004May 04ESA/ESTEC - JPUS de-briefing14 Example: Low-level operations

05/05/2004May 04ESA/ESTEC - JPUS de-briefing15 Outline

05/05/2004May 04ESA/ESTEC - JPUS de-briefing16 Porting Strategies Porting of types Porting of Ada generic package Porting of protected objects and protected entries

05/05/2004May 04ESA/ESTEC - JPUS de-briefing17 Porting of Types New scalar types Enumeration types Arrays Heterogeneous data structures (records)

05/05/2004May 04ESA/ESTEC - JPUS de-briefing18 Porting of Types Arrays and Records Arrays An array is in Java encapsulated in a class together with the operations on the array. This solution is not strictly necessary to carry out the porting, but it is more object oriented. Heterogeneous data structures (records) A record in Ada is replaced by a class in Java. The operations on the variables of the record type in Ada are in Java implemented inside the class.

05/05/2004May 04ESA/ESTEC - JPUS de-briefing19 Porting of Types Example Arrays and Records (1) subtype Command_Index is Natural range 1.. Schedule_Size; type Command_Schedule is array (Command_Index) of Optional_Command_Schedule_Info;

05/05/2004May 04ESA/ESTEC - JPUS de-briefing20 Porting of Types Example Arrays and Records (2) type Optional_Command_Schedule_Info(Void : Boolean := True) is record case Void is when True => null; when False => Cmd_Schedule_Info : Command_Schedule_Info; end case; end record;

05/05/2004May 04ESA/ESTEC - JPUS de-briefing21 Porting of Types Example Arrays and Records (3) type Command_Schedule_Info is record TC_Packet : PUS.PUS_Packet; Sub_Schedule_ID_Inf : Sub_Schedule_ID; Scheduling_Event_Spec_Inf : Scheduling_Event_Spec; Time_Tag : On_Board_Scheduling_Types.CUC_Time; Actual_Schedule_Time : Optional_On_Board_Time; end record;

05/05/2004May 04ESA/ESTEC - JPUS de-briefing22 Porting of Types Example Arrays and Records (4) 1 * packet : TCPacket

05/05/2004May 04ESA/ESTEC - JPUS de-briefing23 Porting of Ada generic package An Ada generic package is a template, which can be parameterized, and from which corresponding nongeneric packages (instances) can be obtained. In Java a class serves as a template for creating objects (instances). Generic Subprogram Parameters Generic Value Parameters Generic Type Parameters

05/05/2004May 04ESA/ESTEC - JPUS de-briefing24 Generic Subprogram Parameters Ada: The implementation of the actual subprogram is given at the instantiation of the generic package. Java: The generic Ada package is ported to an Java abstract class. The actual subprogram is implemented in the subclass inheriting from the abstract class.

05/05/2004May 04ESA/ESTEC - JPUS de-briefing25 Generic Value Parameters Ada: generic value parameters are used for passing values or variables to a generic package Java: passing the parameters via the constructor.

05/05/2004May 04ESA/ESTEC - JPUS de-briefing26 Generic Value Parameters Example Public class CommandSchedule { // Attributes private CommandScheduleInfo [] cmdSchedule; private final int schSize; //Constructor. public CommandSchedule(int scheduleSize){ schSize = scheduleSize; cmdSchedule = new CommandScheduleInfo[schSize]; } // Methods… }

05/05/2004May 04ESA/ESTEC - JPUS de-briefing27 Generic Type Parameters Discrete types –Ada : Which discrete type is defined at the instantiation –Java : Integer Private types –Ada: Any type where assignment and comparison is allowed –Java : PUSPacket class, or more general, Object class

05/05/2004May 04ESA/ESTEC - JPUS de-briefing28 Generic Type Parameters Example Discrete Types type Sub_Schedule_ID is ( ). The range of the type is used for indexation of arrays. type Sub_Schedule_Times_Type is array (Sub_Schedule_ID)of PUS_Data_Types.On_Board_Time; Sub_Schedule_Times : Sub_Schedule_Times_Type; In Java: integer type. The array indexation is made by having the number of sub schedules as a constant in e.g. the class MissionParameters.java. private int[] subScheduleTimes = new int[MissionParameters.NUMBER_OF_SUBSCHEDULES];

05/05/2004May 04ESA/ESTEC - JPUS de-briefing29 Porting of Protected objects and Protected entries Protected objects in Ada are implemented in Java by using synchronized methods. Protected entries in Ada are implemented in Java by using the wait/notify construction in Java

05/05/2004May 04ESA/ESTEC - JPUS de-briefing30 Outline

05/05/2004May 04ESA/ESTEC - JPUS de-briefing31 Conclusion Porting: need of a model to understand the Ada code (i.e.:UML) need of a well-defined porting strategy: –Ada 83 procedural language –Ada 95 has some object-based features –Java object oriented language Some issues to address: direct communication with the hardware how to represent low level data types with Java

05/05/2004May 04ESA/ESTEC - JPUS de-briefing32 Future work Java –Full implementation of the services –Port to Hard Real Time Java (Aero/jamaica) –Assess the architectural performances –Testing

05/05/2004May 04ESA/ESTEC - JPUS de-briefing33 What was done to arrive at these findings –3500 LOC of Java implementation over Ada code –Implemented: Telecommand and Telemetry packets Telecommand verification service On board scheduling service Test service –UML model of the Ada code –UML reversed engineering design of implemented functionalities –Running demonstrator

05/05/2004May 04ESA/ESTEC - JPUS de-briefing34

05/05/2004May 04ESA/ESTEC - JPUS de-briefing35

05/05/2004May 04ESA/ESTEC - JPUS de-briefing36