Friday, July 12, 2013

Athens-HTML Architecture

In this post, I will describe some important classes of Athens that are used in the Pharo implementation (Athens-Cario) and the Amber implementation (Athens-HTML).

In the diagram below, you can see that there are three kinds of packages (the diagram contains only some packages, classes and methods). Athens-Core-* packages contain classes that are shared among all Athens implementations. For example, AthensCanvas contains functionality for setting the paint and the shape that should be drawn. It also contains a "draw" methods that delegates the drawing process to the paint/shape using double dispatch. The actual drawing code is located in the Paint classes. There are Paint classes for Athens-Cairo and Athens-HTML. The Paint classes in Amber-Core are abstract, i.e. they only define the interface and all methods are subclass responsibility.

At the moment, it is not possible to share Athens-Core classes between Pharo and Amber Smalltalk. Amber has some limitations, e.g. selectors may not contain underscores and class variables are not supported (only class instance variables). However, I could copy most of the code of the core classes.

No comments:

Post a Comment