Abstract
Custom attributes as e.g., supported by the .NET framework complemented by pre- or post-processing tools can be used to integrate domain-specific concepts into general-purpose language technology, representing an interesting alternative to domain-specific languages in supporting model-driven development. For this purpose, it is important that dependency relationships between custom attributes, e.g., stating that a certain attribute requires or excludes another attribute, can be specified and checked for during model processing (compilation). Such dependencies can be viewed as an important part of expressing the meta-model of the domain-specific concepts represented by custom attributes.
In this paper, we present an approach to specifying and enforcing dependencies between .NET custom attributes, which naturally extends the built-in .NET support. In this approach, dependencies are specified declaratively by using custom attributes to decorate other custom attributes. Once the dependency declaration is made part of the custom attribute support, one can write tools that enforce dependencies based on .NET meta-program API-s like CodeDom or Reflection. In this paper, we present such a tool, called ADC (for attribute dependency checker).
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
De Volder, K., Murphy, G.C., Bryant, A., Catton, A.: Explicit Programming. In: Proc. of AOSD 2002, pp. 10–18. ACM Press, New York (2002)
Aho, V., Sethi, R., Ullman, J.D.: Compilers Principles, Techniques and Tools. Addison Wesley, Reading (1988)
van Deursen, A., Klint, P., Visser, J.: Domain-Specific Languages. ACM SIGPLAN Notices 35, 26–36 (2000)
McLaughlin, B.: Java and XML, 2nd edn. O’Reilly, Sebastopol (2001)
Frankel, D.S.: Model Driven Architecture - Applying MDA to Enterprise Computing. Wiley, Chichester (2003)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns. Addison-Wesley, Reading (1995)
Roman, E., Ambler, S., Jewell, T.: Mastering Enterprise JavaBeans. Wiley, Chichester (2001)
Booch, G., Jacobson, I., Rumbaugh, J.: The Unified Modeling Language User Guide. Addison-Wesley, Reading (1998)
Hedin, G.: Attribute Extension - A Technique for Enforcing Programming Convetions. Nordic Jounral of Computing (1997)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: An Overview of AspectJ. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 327–353. Springer, Heidelberg (2001)
Kiczales, G., Lamping, J., Menhdhekar, A., Maeda, C., Lopes, C., Loingtier, J., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–243. Springer, Heidelberg (1997)
Zderadicka, I.: CS CODEDOM Parser (2002), http://ivanz.webpark.cz/csparser.html
Liberty, J.: Programming C#. O’Reilly, Sebastopol (2001)
Newkirk, J., Vorontsov, A.: How.NET’s Custom Attributes Affect Design. IEEE SOFTWARE 19(5), 18–20 (2002)
Czarnecki, K., Eisenecker, U.W.: Generative Programming. Addison-Wesley, Reading (2000)
Knuth, D.: The Genesis of Attribute Grammars. In: Proc. of International Workshop WAGA (1990)
Abadi, M., Banerjee, A., Heintze, N., Riecke, J.G.: A Core Calculus of Dependency. In: Proc. of the 26th ACM SIGPLAN-SIGACT on Principles of Programming Languages (POPL), pp. 147–160 (1999)
Shomrat, M., Yehudai, A.: Obvious or Not? Regulating Architectural Decisions Using Aspect-Oriented Programming. In: Proc. of Aspect-Oriented Software Development - AOSD 2001 (2001)
Voelter, M.: A Collection of Patterns for Program Generation. In: Proc. EuroPLoP (2003)
Voelter, M., Schmid, A., Wolf, E.: Server Components Patterns, Illustrated with EJB. Wiley & Sons, Chichester (2002)
Minsky, N.H.: Why Should Architectural Principles be Enforced. In: Proc. of IEEE Computer Security, Dependability, and Assurance: From Needs to Solutions (1998)
NET Framework MSDN Documentation (2002), ms-help.MS.VSCC/MS.MSDNVS/Netstart/html/sdkstart.htm
Paige, R.: Future Directions in Program Transformations. ACM Computing Surveys 28, 170–170 (1996)
Prosise, J.: Programming Microsoft.NET. Microsoft Press, Redmond (2002)
Cepa, V.: Implementing Tag-Driven Transformers with Tango. In: Bosch, J., Krueger, C. (eds.) ICOIN 2004 and ICSR 2004. LNCS, vol. 3107, pp. 296–307. Springer, Heidelberg (2004)
Cepa, V., Mezini, M.: Language Support for Model-Driven Software Development (Editor M. Aksit) Special Issue Science of Computer Programming (Elsevier) on MDA: Foundations and Applications Model Driven Architecture (2004)
NET Attribute Dependency Checker (ADC) Tool (2003), http://www.st.informatik.tu-darmstadt.de/static/staff/Cepa/tools/adc/index.html
Taha, W., Sheard, T.: Multi-stage Programming. ACM SIGPLAN Notices 32(8) (1997)
Meta Object Facility (MOF) Specification Version 1.4 (2002), http://www.omg.org
PMD Java Source Code Scanner (2003), http://pmd.sourceforge.net
Borland TogetherJ (2003), http://www.borland.com/together/
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cepa, V., Mezini, M. (2004). Declaring and Enforcing Dependencies Between .NET Custom Attributes. In: Karsai, G., Visser, E. (eds) Generative Programming and Component Engineering. GPCE 2004. Lecture Notes in Computer Science, vol 3286. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30175-2_15
Download citation
DOI: https://doi.org/10.1007/978-3-540-30175-2_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-23580-4
Online ISBN: 978-3-540-30175-2
eBook Packages: Springer Book Archive