Abstract
We propose method shells, which is a module system for avoiding conflicts on customization by language mechanisms such as aspects in AspectJ and open classes in Ruby. These mechanisms allow programmers to customize a library without rewriting original source code but by only describing differences in a separate file. We call these mechanisms destructive class extensions. A problem with destructive class extensions is conflicts on customization. Different customizations may differently modify the same class. To address this problem, we propose a new module system named method shells. With this system, programmers can avoid conflicts since the module system automatically switches a set of customizations that has to be applied together according to the contexts declared by programmers. We present the idea of this module system and then its formal semantics. We also present an extension of Java that supports method shells.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C., Loingtier, J., Irwin, J.: Aspect-oriented programming. In: Aksit, M., Auletta, V. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)
: Ruby programming language., http://www.ruby-lang.org/
Batory, D., Sarvela, J.N., Rauschmayer, A.: Scaling step-wise refinement. IEEE Transactions on Software Engineering 30(6) (2004)
Chiba, S., Igarashi, A., Zakirov, S.: Mostly modular compilation of crosscutting concerns by contextual predicate dispatch. In: Proceedings of the ACM international conference on Object oriented programming systems languages and applications. OOPSLA ’10, pp. 539–554. ACM Press, New York (2010)
Dinkelaker, T., Mezini, M., Bockisch, C.: The art of the meta-aspect protocol. In: Proceedings of the 8th ACM international conference on Aspect-oriented software development. AOSD ’09, pp. 51–62. ACM Press, New York (2009)
Aksit, M., Rensink, A., Staijen, T.: A graph-transformation-based simulation approach for analysing aspect interference on shared join points. In: Proceedings of the 8th ACM international conference on Aspect-oriented software development. AOSD ’09, pp. 39–50. ACM Press, New York (2009)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An overview of AspectJ. In: Lee, S.H. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)
Millstein, T., Reay, M., Chambers, C.: Relaxed multijava: balancing extensibility and modular typechecking. In: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications. OOPSLA ’03, pp. 224–240. ACM Press, New York (2003)
Mcdirmid, S., Flatt, M., Hsieh, W.C.: Jiazzi: New-age components for old-fashioned java. In: Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Applications. OOPSLA ’11, pp. 211–222. ACM Press, New York (2001)
Kiczales, G., Mezini, M.: Aspect-oriented programming and modular reasoning. In: Inverardi, P., Jazayeri, M. (eds.) ICSE 2005. LNCS, vol. 4309, pp. 49–58. Springer, Heidelberg (2006)
Steimann, F.: The paradoxical success of aspect-oriented programming. ACM SIGPLAN Notices 41(10), 481–497 (2006)
Douence, R., Fradet, P., Südholt, M.: A framework for the detection and resolution of aspect interactions. In: Batory, D., Blum, A., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 173–188. Springer, Heidelberg (2002)
Douence, R., Fradet, P., Südholt, M.: Composition, reuse and interaction analysis of stateful aspects. In: Proceedings of the 3rd international conference on Aspect-oriented software development. AOSD ’04, pp. 141–150. ACM Press, New York (2004)
Malayeri, D., Aldrich, J.: Cz: multiple inheritance without diamonds. In: Proceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications. OOPSLA ’09, pp. 21–40. ACM Press, New York (2009)
Ekman, T., Hedin, G.: The jastadd extensible java compiler. In: Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications. OOPSLA ’07, pp. 1–18. ACM Press, New York (2007)
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight java: a minimal core calculus for java and gj. ACM Trans. Program. Lang. Syst. 23(3), 396–450 (2001)
Takeyama, F., Chiba, S.: An advice for advice composition in AspectJ. In: Baudry, B., Wohlstadter, E. (eds.) SC 2010. LNCS, vol. 6144, pp. 122–137. Springer, Heidelberg (2010)
Kristensen, B.B., Madsen, O.L., Møller-Pedersen, B., Nygaard, K.: Abstraction mechanisms in the beta programming language. In: Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages. POPL ’83,, pp. 285–298. ACM Press, New York (1983)
Madsen, O.L., Moller-Pedersen, B.: Virtual classes: a powerful mechanism in object-oriented programming. In: Conference proceedings on Object-oriented programming systems, languages and applications. OOPSLA ’89, pp. 397–406. ACM Press, New York (1989)
Filman, R.E., Friedman, D.P.: Aspect-oriented programming is quantification and obliviousness. In: Filman, R.E., Elrad, T., Clarke, S., Akşit, M. (eds.) Aspect-Oriented Software Development, pp. 21–35. Addison-Wesley, Reading (2005)
Bracha, G., von der Ahé, P., Bykov, V., Kashai, Y., Maddox, W., Miranda, E.: Modules as objects in newspeak. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 405–428. Springer, Heidelberg (2010)
Millstein, T.: Practical predicate dispatch. In: Proc. of ACM OOPSLA, pp. 345–364. ACM, New York (2004)
Smith, R.B., Ungar, D., Smith, R.B., Ungar, D.: A simple and unifying approach to subjective objects. TAPOS 2, 161–178 (1996)
Hirschfeld, R., Costanza, P., Nierstrasz, O.: Context-oriented programming. Journal of Object Technology 7(3), 125–151 (2008)
Appeltauer, M., Hirschfeld, R., Masuhara, H.: Improving the development of context-dependent java applications with contextj. In: International Workshop on Context-Oriented Programming. COP ’09, vol. 5, pp. 5:1–5:5. ACM, New York (2009)
Appeltauer, M., Hirschfeld, R., Haupt, M., Masuhara, H.: Contextj: Context-oriented programming with java. Information and Media Technologies 6(2), 399–419 (2011)
Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Classboxes: Controlling visibility of class extensions. In: Computer Languages, Systems and Structures (2005)
Bergel, A.: Classbox/j: Controlling the scope of change in java. In: Proceedings of Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA’05), pp. 177–189. ACM Press, New York (2005)
Sato, Y., Chiba, S.: Loosely-separated “sister” namespaces in Java. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 49–70. Springer, Heidelberg (2005)
Akai, S., Chiba, S.: Method shelters: avoiding conflicts among class extensions caused by local rebinding. In: Proceedings of the 11th annual international conference on Aspect-oriented Software Development. AOSD ’12, pp. 131–142. ACM Press, New York (2012)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 IFIP International Federation for Information Processing
About this paper
Cite this paper
Takeshita, W., Chiba, S. (2013). Method Shells: Avoiding Conflicts on Destructive Class Extensions by Implicit Context Switches. In: Binder, W., Bodden, E., Löwe, W. (eds) Software Composition. SC 2013. Lecture Notes in Computer Science, vol 8088. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-39614-4_4
Download citation
DOI: https://doi.org/10.1007/978-3-642-39614-4_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-39613-7
Online ISBN: 978-3-642-39614-4
eBook Packages: Computer ScienceComputer Science (R0)