1 / 30

Porting Implementation of Packet Utilization Standard from ADA to JAVA

Porting Implementation of Packet Utilization Standard from ADA to JAVA. JPUS de-briefing. Annelie Hultman (TEC-EME) Donata Pedrazzani (TEC-EMS) ESA/ESTEC 2004. Introduction. Final presentation of the YGT period Ported part of the PUS Ada framework to Java Aim of presentation

jovita
Download Presentation

Porting Implementation of Packet Utilization Standard from ADA to JAVA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. 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 ESA/ESTEC - JPUS de-briefing

  3. 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 ESA/ESTEC - JPUS de-briefing

  4. 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 ESA/ESTEC - JPUS de-briefing

  5. 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 ESA/ESTEC - JPUS de-briefing

  6. 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 ESA/ESTEC - JPUS de-briefing

  7. Encapsulation of data/visibility(2) ESA/ESTEC - JPUS de-briefing

  8. Reusability concepts Ada • Specification and compiled units Java • javadoc documentation and bytecode (compiled .class files) ESA/ESTEC - JPUS de-briefing

  9. Polymorphism Def: ability for references and collections to hold objects of different types Ada • Explicit: use of tagged types Java • Implicit from the language ESA/ESTEC - JPUS de-briefing

  10. Polymorphism in Java ESA/ESTEC - JPUS de-briefing

  11. 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 ESA/ESTEC - JPUS de-briefing

  12. 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 ESA/ESTEC - JPUS de-briefing

  13. 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 ESA/ESTEC - JPUS de-briefing

  14. Porting Strategies • Porting of types • Porting of Ada generic package • Porting of protected objects and protected entries ESA/ESTEC - JPUS de-briefing

  15. Porting of Types • New scalar types • Enumeration types • Arrays • Heterogeneous data structures (records) ESA/ESTEC - JPUS de-briefing

  16. Porting of TypesArrays 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.  ESA/ESTEC - JPUS de-briefing

  17. Porting of TypesExample Arrays and Records (1) subtype Command_Index is Natural range 1 .. Schedule_Size; type Command_Schedule is array (Command_Index) ofOptional_Command_Schedule_Info; ESA/ESTEC - JPUS de-briefing

  18. Porting of TypesExample 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; ESA/ESTEC - JPUS de-briefing

  19. Porting of TypesExample 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; ESA/ESTEC - JPUS de-briefing

  20. 1 * packet : TCPacket Porting of TypesExample Arrays and Records (4) ESA/ESTEC - JPUS de-briefing

  21. 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 ESA/ESTEC - JPUS de-briefing

  22. 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. ESA/ESTEC - JPUS de-briefing

  23. 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. ESA/ESTEC - JPUS de-briefing

  24. Generic Value ParametersExample Public class CommandSchedule { // Attributes private CommandScheduleInfo [] cmdSchedule; private final int schSize; //Constructor. public CommandSchedule(int scheduleSize){ schSize = scheduleSize; cmdSchedule = new CommandScheduleInfo[schSize]; } // Methods… } ESA/ESTEC - JPUS de-briefing

  25. 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 ESA/ESTEC - JPUS de-briefing

  26. Generic Type ParametersExample 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)ofPUS_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];  ESA/ESTEC - JPUS de-briefing

  27. 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 ESA/ESTEC - JPUS de-briefing

  28. 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 ESA/ESTEC - JPUS de-briefing

  29. 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 ESA/ESTEC - JPUS de-briefing

  30. Future work • Java • Full implementation of the services • Port to Hard Real Time Java (Aero/jamaica) • Assess the architectural performances • Testing ESA/ESTEC - JPUS de-briefing

More Related