Code Fragments and Benchmark Applications
19 pages
English

Code Fragments and Benchmark Applications

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
19 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description







D12: Code Fragments and
Benchmark Applications




Project Number: 507442
Project Acronym: MHP-KDB
Project Title: The MHP Knowledge Project




Document Type: Deliverable
Document No.: D12
Title: Code fragments and benchmark applications
Version No.: 1
Related to work package: WP4
Type of the Deliverable: Prototype
Dissemination level: Public

Authors: BMT, DR, DW, IRT, ITA, PCE, PEL, RBB, TCL,
TN, UDE
Due date: 28. February 2005
Delivery date: 31. March 2005



Abstract:
This document accompanies & presents the prototype deliverable D12, the main
part of which is the actual set of code fragments and benchmark applications
provided in the MHP Knowledge Database.



Keyword list:
Code fragments, benchmark applications, content of MHP KDB

MHP-KDB Deliverable D12 31 March 2005
Code fragments and benchmark applications

Table of Contents

1. INTRODUCTION....................................................................................................... 4
1.1. SCOPE OF THE DOCUMENT...................................................................................................... 4
1.2. KNOWLEDGE DATABASE CONTENTS..................................................................................... 4
1.3. INTRODUCTION TO CODE FRAGMENTS & BENCHMARK APPLICATIONS.......................... 5
2. PRESENTATION OF THE MHP-KDB CONTENT FORMAT ................................... 6
2.1. WHAT IS AVAILABLE IN THE ...

Sujets

Informations

Publié par
Nombre de lectures 104
Langue English

Extrait

      D12: Code Fragments and Benchmark Applications 507442 MHP-KDB The MHP Knowledge Project Deliverable  21DCode fragments and benchmark applications 1W P4 Prototype Public BMT, DR, DW, IRT, ITA, PCE, PEL, RBB, TCL, TN, UDE 28. February 2005 31. March 2005     Project Number: Project Acronym: Project Title:     Document Type: Document No.: Title: Version No.: Related to work package: Type of the Deliverable: Dissemination level:  Authors: Due date: Delivery date:    Abstract: This document accompanies & presents the prototype deliverable D12, the main part of which is the actual set of code fragments and benchmark applications provided in the MHP Knowledge Database.    Keyword list: Code fragments, benchmark applications, content of MHP KDB   
MHP-KDB Deliverable D12 Code fragments and benchmark applications  31 March 2005 Table of Contents  1. INTRODUCTION.......................................................................................................4 1.1. SCOPE OF THE DOCUMENT......................................................................................................4 1.2. KNOWLEDGE DATABASE CONTENTS.....................................................................................4 1.3. INTRODUCTION TO CODE FRAGMENTS & BENCHMARK APPLICATIONS..........................5 2. PRESENTATION OF THE MHP-KDB CONTENT FORMAT...................................6 2.1. WHAT IS AVAILABLE IN THE MHP-KDB...................................................................................6 2.2. CODE SAMPLE FRAMEWORK...................................................................................................9 3. OVERVIEW OF THE MHP-KDB CODE FRAGMENTS..........................................10 3.1. AVAILABLE CODE FRAGMENTS............................................................................................10 3.2. UPCOMING CODE FRAGMENTS.............................................................................................15 4. OVERVIEW OF THE MHP-KDB BENCHMARK APPLICATIONS........................16 4.1. AVAILABLE BENCHMARK APPLICATIONS...........................................................................16 4.2. UPCOMING BENCHMARK APPLICATIONS............................................................................17 5. CONCLUSION........................................................................................................19 MHP-KDB  IST 507442 3 / 19
31 March 2005 MHP-KDB Deliverable D12 Code fragments and benchmark applications  1. Introduction This document accompanies the prototype deliverable D12, the main part of which is the actual set of code fragments and benchmark applications provided in the MHP Knowledge Database. 1.1. Scope of the document This document gives an overview of the actual set of code fragments and benchmark applications provided in the MHP Knowledge Database as part of work-package WP4.2 result.  First, it presents the MHP-KDB content format and then it presents on the one hand the code fragments and on the other hand the benchmark applications that are created by the project.  Highlight is put on the description on how a piece of sample code or a benchmark application helps to solve interoperability issues.  The document covers the code fragments and benchmark applications that are available in the MHP-KDB in February 2005 and gives an overview of code fragments and benchmark applications that are currently planned and that will be provided during the project lifetime. 1.2. Knowledge Database contents The MHP Knowledge Database has been created as an information portal for MHP application designers. For example, solutions for implementation problems are given, best practices are shown and benchmark issues are addressed under the context of the MHP-KDB portal. It can be accessed at: http://mhp-kdb.s3.uni-essen.de/nukes/?module=login&op=loginThe major target group of the MHP Knowledge Database consists of application developers of all skill levels, from students to senior software developers. Whenever they encounter a question during specification or implementation of a service, they can have a look into the MHP Knowledge Database in order to find out if the problem is likely to be solvable. From a practical point of view, it is often more useful to offer code fragments or a whole application to the user than giving only abstract information or procedures. Therefore methods for uploading and downloading such code samples are provided. Sample code can be attached to documents of the MHP-KDB, e.g. an issue or a solution that give information about the code and the context in which it should be used. Further information about the document types used in the KDB is provided in section 2.1. There are two ways to access benchmark applications:  A test center can be accessed online via a single section of the database.  Benchmark applications and patterns for introducing benchmarks into applications can be downloaded as attachments of KDB documents. MHP-KDB  IST 507442 4 / 19
31 March 2005 MHP-KDB Deliverable D12 Code fragments and benchmark applications  1.3. Introduction to code fragments & benchmark applications Code Fragments  The MHP Knowledge Database will offer a growing number of reference solutions for elementary implementation problems in the form of code fragments. These fragments are not applications in their own right, but they contain mostly one or two classes that surround the example code in order to be executable. For example, a code fragment that demonstrates the reading of an SI-table would print the content onto the screen, but that is all. The members of the MHP-KDB project are taking precautions to provide only code fragments that ensure the highest possible interoperability. If full interoperability cannot be ensured, this is mentioned in the documentation. A review procedure for future entries by external developers has been elaborated in order to keep the quality of the available information high. Users of the MHP Knowledge Database can study the well-commented code fragments in order to learn about the general principle behind the solution of a special problem. They can as well copy and paste the important passages, as long as they mention that they used input from the MHP Knowledge Database within their application. At last, they can compare their existing solutions with the reference solution and either improve their version or provide their solution as alternative for the Knowledgebase. When looking at the solutions it might be important to know that most examples use classes from the MHP Knowledge Database framework. This is a way to keep the examples itself small, as the code fragment does not have to care for rendering an own GUI. Yet it is important that the MHP-KDB sample code framework classes are on the object carousel as well when testing.  Benchmark Applications  A benchmark application evaluates a feature or the performance in the MHP chain. The benchmark itself is a standalone MHP application combined with special circumstances inside the MHP chain if necessary. It focuses on a certain property and proves or assesses its behaviour. Each benchmark should be run on as many MHP devices as possible to receive an objective result. The different results of the benchmark application will be presented in a corresponding report. The MHP-KDB user benefits from the results by making conclusions about physical and technical barriers. The benchmark extracts what to keep in mind by using a certain feature additional to the definition in the specification. It shows also the commonness of the different MHP devices. The use of this valuable information increases the interoperability of an application. As the benchmark applications enables analysis of MHP features and obtain results of the MHP performance at different levels, it will be possible to generate knowledge about the state of the art in the related MHP topics. All benchmark applications can be reused as base for future MHP tests by taking into account the possible improvement proposals, which could be generated. MHP-KDB  IST 507442 5 / 19
31 March 2005 MHP-KDB Deliverable D12 Code fragments and benchmark applications  2. Presentation of the MHP-KDB content format 2.1. What is available in the MHP-KDB At this moment, the MHP-KDB contains mainly questions (“issues”) about the MHP specifications. In the future, the database will also hold other topics as questions about MHP terminals, MHP applications, MHP tools and so on.  Figure 2-1: KDB Issue Screen  The aim of the database is not only having questions, but also a large amount of answers (solutions) to these questions. At the moment, the answers come only from within the project, but as soon as the MHP-KDB is open for the public, the whole MHP community can answer the questions. An answer to a question can for example be just a piece of text or a piece of code that describes the solution to the problem. It has to be noted that one issue can have more than one solution.  MHP-KDB  IST 507442 6 / 19
MHP-KDB Deliverable D12 Code fragments and benchmark applications  31 March 2005  Figure 2-2: KDB Solution Screen  The answer can also be accompanied with some java code fragment that illustrates how the problem can be solved in the best way and/or with a report that shows the issue in a wider context. MHP-KDB  Figure 2-3: KDB Solution Attachments IST 507442  7 / 19
MHP-KDB Deliverable D12 31 March 2005 Code fragments and benchmark applications  Beside a java code fragment, a benchmark application can also be an answer to a question. The benchmark application can be accompanied with a benchmark report.  More technical information about the MHP-KDB can be found in deliverable D6: KDB Definition and Implementation.  The project partners agree that all code fragments and benchmark applications shall be open source. This makes it possible to spread the samples quickly over the whole MHP community. The Open Source Initiative offers a variety of existing license agreements. The MHP-KDB project decided to use the LGPL because it matches the requirements well. Additionally it was decided to add a “code of conduct” to provide information about the reuse of MHP-KDB code fragments:  “This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA We are interested to continuously improve the quality of our Knowledge Database. Therefore we kindly ask you to report back any bug you find in our software or any improvement you are able to suggest. This can be done via writing comments into the database or by an email to feedback@mhp-knowledgebase.org. Furthermore we would appreciate if you could inform us (also via feedback@mhp-knowledgebase.org) about any broadcast MHP application, which was developed using our Knowledge Database.”  The LGPL with the added code of conduct has the following advantages: o Many users of the MHP-KDB will be able to accept the licence. o The developer who reuses the MHP-KDB code fragments does not have to disclose his sources. o The MHP-KDB project will get feedback on reuse of the code fragments. o The quality of the database will increase by suggestions for improvements.  MHP-KDB  IST 507442 8 / 19
31 March 2005 MHP-KDB Deliverable D12 Code fragments and benchmark applications  2.2. Code sample framework The MHP-KDB code framework was developed to facilitate the development of example code to be put into the MHP Knowledge Database. The main targets were: o A consistent Look & Feel for all examples that are developed by project partners, mainly for dissemination purposes. o Providing basic UI classes that can be reused in all examples so that partners do not have to invent the wheel twice. o Providing a common logging interface. o Providing a way to easily download and test examples from the MHP Knowledge Database.  The usage of the framework is mandatory, as long as there are no reasons based on the nature of the example that speak against it. This might be the case in HAVi user interface examples and similar tasks. To demonstrate example code fragments without any overhead the following structure is used:  «interface»example01javax.tv.xlet.XletKDBTemplate+initXlet(in ctx : javax.tv.xlet.XletContext)#scene : org.havi.ui.HScene+initXlet(in ctx : javax.tv.xlet.XletContext)+startXlet()+destroyXlet(in cond : Boolean)#xletContext : javax.tv.xlet.XletContext+startXlet()#gui : Integer+pauseXlet()+pauseXlet()#BASIC : int = 1+destroyXlet(in cond : Boolean)#ADVANCED : int = 2#LOOK : int = 3+initXlet(in ctx : javax.tv.xlet.XletContext)+startXlet()+pauseXlet()+destroyXlet(in cond : Boolean)+log(in text : String) The example class is an Xlet, but it does not directly implement the Xlet interface. Instead it inherits from the KDBTemplate that implements the Xlet interface and builds up the GUI depending on the example. Three different GUIs are defined. Additionally a Logger is provided to easily log debug information to screen, RS232 and return channel. As a result the MHP-KDB example includes the required code fragments only. Any of the other methods needed to complete the example are implemented in the KDBTemplate. MHP-KDB  IST 507442 9 / 19
31 March 2005 CMoHdPe- fKrDagB mDeenlitvs earnadbl eb eDn1ch2 mark applications  3. Overview of the MHP-KDB code fragments TDhaitsa bpaasrte  igni vFees braun aroyv e2r0v0ie5 wa nodf  lcisotds eo tfrhaegr moneentss t haalrt ewaildl yc oavmaeil laabtleer .i n MHP Knowledge 3.1. Available code fragments Available code fragments of the MHP Knowledge Database are listed below using the following template Issue title (as in the Issue description (as in the MHP-KDB) MHP-KDB) How does a code fragment help to solve the issue? What is in the code fragment? How does it work?  Stream event log What is the delay of one event? analyser The log analyser analyses and compares the logging data generated by the event generator and the event listener. The main task of the application is to display the time difference from an event was broadcasted until the event listener received it. The log analyser also displays if there are any inconsistencies in the events sent and the events received, this meaning if any events are missing in reception.  Retrieve EIT event  How do I access information on the upcoming programme on a digital TV service? The code fragment demonstrates a simple EPG that allows tuning to a service and then retrieves the available present/following and scheduled information from the Event Information Table. It shows the two-step technique of requesting events from the EIT starting at the SIDatabase, that is first getting the SIService from the Service Description Table and requesting the events of the SIService. An overall SI access documentation is available containing a chapter about building an EPG. The documentation is continually enhanced with knowledge from other related tasks.  MHP-KDB  IST 507442 10 / 19
31 March 2005 MHP-KDB Deliverable D12 Code fragments and benchmark applications   Non-EIT related  How do I read PSI/SI information such as SDT or PMT? MHP functionality Multiple code fragments show how to read information from all tables directly accessible via org.dvb.si. The tables handled are TSDT, TDT, TOT, SDT (incl. RST), PMT, BAT and NIT. These examples read the respective information from the service or transport stream they are signalled on. If applicable, also the retrieval and parsing of descriptors is shown (NIT, TOT). The reading of user defined (private) descriptors is handled in a separate example. Further code fragments show the access to information from other transport streams by tuning, taking the SDT as an example and the monitoring of the present / following event information of a service. All examples show the basic steps towards the retrieval of the desired information: Getting the SIDatabase, requesting the org.dvb.si object that represents the desired DVB table (e.g. SIService for the service description table of one service), reading the desired information and formatting it for screen output. An overall SI access documentation is available containing chapters about reading the different SI tables. The documentation is continually enhanced with knowledge from other related tasks.  Read files How can I read a file of the persistent storage in my application? The example reads files stored in the persistent storage. The user chooses a file in a list. Then the content of this file is displayed in a text label. During the application some debug printouts will be generated. The code fragment shows step by step how to open, read and close the file. It demonstrates how to access the resource and how to check required permissions. It is not demonstrated how to sign the application (required to get read permissions).  Write files How can I write a file in the persistent storage in my application? The example writes files to the persistent storage. The user enters a file name and some content into text boxes. Then he presses the write button and the file with the given content will be written to the persistent storage. During the application some debug printouts will be generated. The code fragment shows step by step how to create, write and close the file. It demonstrates how to access the resource and how to check required permissions. It is not demonstrated how to sign the application (required to get write permissions).  Delete files How can I delete a file of the persistent storage in my application? The example deletes files stored in the persistent storage. The user chooses a file in a list. This file is immediately deleted. During the application some debug printouts will be generated. The code fragment shows step by step how to delete the file. It demonstrates how to access the resource and how to check required permissions. It is not demonstrated how to sign the application (required to get write permissions).   MHP-KDB  IST 507442 11 / 19
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents