Treffer: BabyJ: From Object Based to Class Based Programming via Types

Title:
BabyJ: From Object Based to Class Based Programming via Types
Authors:
Anderson, Christopher cla97@doc.ic.ac.uk, Drossopoulou, Sophia scd@doc.ic.ac.uk
Source:
ENTCS: Electronic Notes in Theoretical Computer Science. Oct2003, Vol. 82 Issue 8, p1-29. 29p.
Database:
Supplemental Index

Weitere Informationen

Object oriented programming can be classified into the object based, and the class based paradigm. Object based languages typically are weakly typed and interpreted, allow member addition and removal, and thus they support flexibility and prototyping. Class based languages are usually strongly typed and compiled, require a rigid class structure and class membership, and thus they support more robust, type safe programs.The two paradigms therefore address the needs of different stages in the programming lifecycle: object based programming better fits the earlier, exploratory phases, whereas class based better fits the latter, consolidation and maintenance phases. Because the transition from one paradigm to the other is not straightforward, programs tend to be developed in one of the two paradigms, thus foregoing the advantages of the other.We suggest that this need not be so, and that the benefits of the two paradigms can be combined: The earlier, exploratory, programming phases should take place in an object based setting. Then, the program should be incrementally annotated with types. Once fully typed, the program can be mapped onto an equivalent class based program.We demonstrate these ideas through the introduction of BabtJ, a formalization of Javascript. We define BabyJT, a typed extension of BabyJ. A permissive type in BabyJ allows the typing process to be incremental. We then define a meaning preserving transformation of BabyJT programs to Java programs. [Copyright &y& Elsevier]