-
Notifications
You must be signed in to change notification settings - Fork 0
/
abstract.txt
1 lines (1 loc) · 990 Bytes
/
abstract.txt
1
The square-rectangle problem is often cited as an illustration of pitfalls arising when using object-oriented programming (OOP). A number of solutions have been proposed, however, according to the author, none of them solve the problem satisfactorily, mainly because they tackle the problem from within the current OOP paradigm. This paper presents another solution stemming from object morphology (OM), a new object-oriented paradigm developed to model mutable phenomena. In the framework of OM the problem can be solved directly under the basic OM principle that an object may mutate not only with regard to its state, but also with regard to its type. The main contrast between the presented and the other solutions is that constraint violations caused by changes in an object’s state are no longer necessarily considered errors; instead they may trigger a mutation of the object’s type. The solution is demonstrated using Morpheus, a proof-of-concept implementation of OM in Scala.