wiki:JCopSamples
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 91 (modified by malte.appeltauer, 10 years ago) (diff)

--

JCop Sample Programs

This site describes some JCop sample programs and provides download links.

Adressbook

Environment
JVM 1.5
JCop
Downloads
zip archive
browse sourcecode

A simple COP example. An adressbook contains persons. By default, a person's name will be returned by the toString method.
Depending on context information, persons can also reveal their address. Data will be either rendered as plain string, with Wiki syntax, or in HTML format.


Author: Malte Appeltauer

Bank Transfer System

Environment
JVM 1.5
JCop
Downloads
zip archive
browse sourcecode

...




Author: Malte Appeltauer

Body Mass Index Calculator

Environment
JVM 1.5
JCop
'Qt Jambi'
win32/64 vers. included
Downloads
browse sourcecode

The calculator was developed using JCop and Qt Jambi in a seminar on approaches of multi-dimensional separation of concerns, including context-oriented programming.

The GUI-based application allows to explicitly manipulate the user's context. The application consideres two kinds of context information:

  • Location. A user can be either from Germany or the U.S., affecting the expectations to the metric system (pound vs. kilograms, feet vs. meters) that are used in BMI value calculation.
  • Background Knowlege. The visualization of the actual BMI result is rendered according to the user's knowledge of BMI. We roughly distinguish between heals professionals and useres without any knowledge. The former will be provided with the concrete BMI, while the latter will be simply informed by a happy or unhappy smilie.

The application uses JCop's declarative layer activation to refine base methods according to the user's context.

Author: Lauritz Thamsen



Mobile Community Application Simulation

Environment
JVM 1.5
JCop
Downloads
browse sourcecode

Mobile community applications allow users to share information about their mood, activities, location, and more. This application focuses on the location representation of buddies on mobile devices for scenarios like the following.

Two students, Lucy and Tim have an appointment at University at 12:00.

  • At 11:50, Lucy arrives at the campus. She checks her mobile device to inform herself about Tim’s current whereabout. The graphical representation of this information depends on Lucy’s context: If Lucy’s device is currently connected to the Internet at high-bandwidth, a map image service is requested to render Tim’s location on a map. Contrary, if the bandwidth is low, Tim’s representation depends on Lucy’s need for active information. This information is stored in Lucy’s user profile and is accessible for applications. In the case that Lucy prefers a smart representation over the refresh period, a map with Tim’s outdated location is shown. The map is labeled with the time stamp of the last update. Alternatively, when Lucy insists on up-to-date information, while the bandwidth is too low for updating the map image, Tim’s position data is simply shown as a text.
  • At the same time, Tim arrives at the underground station, where his GPS device is unable to receive data and more. Thus, his mobile device switches to cell-based location detection. The new location data is calculated based on the position of the current mobile cell. The change of the location provider is propagated to Lucy’s device. Depending on its current context, the device has to decide how it renders this additional location information.

The application allows to navigate Lucy's and Tim's cellphones over a map of Berlin. Changes to the rendering of the cellphone displays are implemented by layers.

Author: Malte Appeltauer


Attachments (3)

Download all attachments as: .zip