Download presentation
Presentation is loading. Please wait.
Published byAugustine Robinson Modified over 9 years ago
1
Porting Implementation of Packet Utilization Standard from ADA to JAVA Annelie Hultman (TEC-EME) Donata Pedrazzani (TEC-EMS) ESA/ESTEC 2004 JPUS de-briefing
2
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
3
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
4
05/05/2004May 04ESA/ESTEC - JPUS de-briefing4 Outline
5
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
6
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
7
05/05/2004May 04ESA/ESTEC - JPUS de-briefing7 Encapsulation of data/visibility(2)
8
05/05/2004May 04ESA/ESTEC - JPUS de-briefing8 Reusability concepts Ada Specification and compiled units Java javadoc documentation and bytecode (compiled.class files)
9
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
10
05/05/2004May 04ESA/ESTEC - JPUS de-briefing10 Polymorphism in Java
11
05/05/2004May 04ESA/ESTEC - JPUS de-briefing11 Example: how polymorphism has been used
12
05/05/2004May 04ESA/ESTEC - JPUS de-briefing12 Outline
13
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
14
05/05/2004May 04ESA/ESTEC - JPUS de-briefing14 Example: Low-level operations
15
05/05/2004May 04ESA/ESTEC - JPUS de-briefing15 Outline
16
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
17
05/05/2004May 04ESA/ESTEC - JPUS de-briefing17 Porting of Types New scalar types Enumeration types Arrays Heterogeneous data structures (records)
18
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.
19
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;
20
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;
21
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;
22
05/05/2004May 04ESA/ESTEC - JPUS de-briefing22 Porting of Types Example Arrays and Records (4) 1 * packet : TCPacket
23
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
24
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.
25
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.
26
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… }
27
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
28
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];
29
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
30
05/05/2004May 04ESA/ESTEC - JPUS de-briefing30 Outline
31
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
32
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
33
05/05/2004May 04ESA/ESTEC - JPUS de-briefing33 What was done to arrive at these findings –3500 LOC of Java implementation over 18000 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
34
05/05/2004May 04ESA/ESTEC - JPUS de-briefing34
35
05/05/2004May 04ESA/ESTEC - JPUS de-briefing35
36
05/05/2004May 04ESA/ESTEC - JPUS de-briefing36
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.