Abstract | ||
---|---|---|
We propose FMJ (Featherweight Multi Java), an extension of Featherweight Java with encapsulated multi-methods thus providing dynamic overloading. Multi-methods (collections of overloaded methods associated to the same message, whose selection takes place dynamically instead of statically as in standard overloading) are a useful and flexible mechanism which enhances re-usability and separation of responsibilities. However, many mainstream languages, such as, e.g., Java, do not provide it, resorting to only static overloading. The proposed extension is conservative and type safe: both ''message-not-understood'' and ''message-ambiguous'' are statically ruled out. Possible ambiguities are checked during type checking only on method invocation expressions, without requiring to inspect all the classes of a program. A static annotation with type information guarantees that in a well-typed program no ambiguity can arise at run-time. This annotation mechanism also permits modeling static overloading in a smooth way. Our core language can be used as the formal basis for an actual implementation of dynamic (and static) overloading in Java-like languages. |
Year | DOI | Venue |
---|---|---|
2009 | 10.1016/j.scico.2009.01.007 | Sci. Comput. Program. |
Keywords | Field | DocType |
type system,static overloading,multi-methods,type safe,standard overloading,featherweight java,dynamic overloading,type checking,static annotation,annotation mechanism,type information guarantee,featherweight multi java,object-oriented languages,multi methods,object oriented languages,object oriented language | Annotation,Programming language,Type checking,Object-oriented programming,Expression (mathematics),Invocation,Computer science,Core language,Ambiguity,Java | Journal |
Volume | Issue | ISSN |
74 | 5-6 | Science of Computer Programming |
Citations | PageRank | References |
8 | 0.82 | 27 |
Authors | ||
3 |
Name | Order | Citations | PageRank |
---|---|---|---|
Lorenzo Bettini | 1 | 871 | 51.50 |
Sara Capecchi | 2 | 144 | 12.52 |
Betti Venneri | 3 | 206 | 16.45 |