Aspect.NET – an aspect-oriented programming tool for Microsoft.NET Vladimir O. Safonov Professor of computer science, Head of laboratory St. Petersburg.

Slides:



Advertisements
Similar presentations
Web Center Certification Sitemap / Formatting Content Web Center Certification Training Intuit Financial Services University.
Advertisements

1 Application Software Course Simulink By: Mahdi Akbari 2010.
Shared-Memory Model and Threads Intel Software College Introduction to Parallel Programming – Part 2.
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.
Program Verification Using the Spec# Programming System ETAPS Tutorial K. Rustan M. Leino, Microsoft Research, Redmond Rosemary Monahan, NUIM Maynooth.
Remote Educational Programming Of Robots (REPOR) Tord Fauskanger Aurelie Aurilla Bechina Arntzen Dag Samuelsen Buskerud University College.
Slide 1 FastFacts Feature Presentation September 7, 2010 We are using audio during this session, so please dial in to our conference line… Phone number:
AQute Eclipse Environment By Peter Kriens CEO aQute OSGi Director of Technology and OSGi Fellow.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
XP New Perspectives on Microsoft Office Word 2003 Tutorial 7 1 Microsoft Office Word 2003 Tutorial 7 – Collaborating With Others and Creating Web Pages.
State of New Jersey Department of Health and Senior Services Patient Safety Reporting System Module 2 – New Event Entry.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
4. Internet Programming ENG224 INFORMATION TECHNOLOGY – Part I
Configuration management
Software change management
© © QA Software Pty Ltd All rights reserved 1 Project Information Management Tools Inspection and Defects Management System for Projects By QA Software.
Suite Suite 2 TPF Software – Overview Binary Editor Remote Scripts zTREX Add-Ins & Project Integration with Source Control Manager.
Information Systems Today: Managing in the Digital World
Page 1 of 30 To the Create Assignment Request Online Training Course An assignment request is created by an assignor to initiate the electronic assignment.
Campaign Overview Mailers Mailing Lists
Setting up Articles Throughout this slide show there will be hyperlinks (highlighted in blue) follow the hyperlinks to navigate to the specified Topic.
PEPS Weekly Data Extracts User Guide September 2006.
Microsoft Access.
State of Connecticut Core-CT Project Query 8 hrs Updated 6/06/2006.
Vanderbilt Business Objects Users Group 1 Reporting Techniques & Formatting Beginning & Advanced.
“The Honeywell Web-based Corrective Action Solution”
August 2012 This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit
Chapter 11: The X Window System Guide To UNIX Using Linux Third Edition.
VOORBLAD.
Renesas Technology America Inc. 1 SKP8CMINI-15,17 Tutorial 2 Creating A New Project Using HEW4.
HORIZONT TWS/WebAdmin TWS/WebAdmin for Distributed
4 Oracle Data Integrator First Project – Simple Transformations: One source, one target 3-1.
© 2012 National Heart Foundation of Australia. Slide 2.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software processes 2.
1 How Do I Order From.decimal? Rev 05/04/09 This instructional training document may be updated at anytime. Please visit and check the.
1 BRState Software Demonstration. 2 After you click on the LDEQ link to download the BRState Software you will get this message.
GaBreeze Employer Website PSR Implementation and April Release Enhancements Flexible Benefits Training for Georgia Benefits Professionals April 2011.
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Systems Analysis and Design in a Changing World, Fifth Edition
James A. Senn’s Information Technology, 3rd Edition
Towards a Standard Interface for Runtime Inspection in AOP Environments OOPSLA Workshop on Tool for AOSD, Seattle, November 2002 Katharina Mehner and Awais.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® PowerPoint 2010 © 2011 The McGraw-Hill Companies,
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
© Paradigm Publishing, Inc Access 2010 Level 2 Unit 2Advanced Reports, Access Tools, and Customizing Access Chapter 8Integrating Access Data.
Copyright © 2009 by SDL Tridion. SDL Tridion®, SDL Tridion R5™, BluePrinting™, SiteEdit™ and WebForms™ are trademarks of SDL Tridion Holding B.V. or its.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 6Protecting and Sharing Workbooks.
Know About E-CTLT Teachers Panel and working area.
Languages for IT & CS Pseudo-code What HTML isn’t Early history Compiling & interpreting Classifying languages The process of programming.
Computer Programming and Basic Software Engineering 9 Building Graphical User Interface Developing a Simple Graphical User Interface (GUI)
TIDE Presentation Florida Standards Assessments 1 FSA Regional Trainings Updated 02/09/15.
Windfall Web Throughout this slide show there will be hyperlinks (highlighted in blue). Follow the hyperlinks to navigate to the specified Topic or Figure.
What’s new in WebSpace Changes and improvements with Xythos 7.2 Effective June 24,
University of British Columbia Software Practices Lab 2005 CASCON A Fluid AOP Editor Terry Hon Gregor Kiczales.
University of British Columbia Software Practices Lab CAS Seminar 06 Fluid AJ - A Simple Fluid AOP Tool Terry Hon Gregor Kiczales.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
IT 211 Project Integration and Deployment Lab #11.
Aspect Oriented Programming Razieh Asadi University of Science & Technology Mazandran Babol Aspect Component Based Software Engineering (ACBSE)
Aspect Oriented Programming Adnan Masood
Aspect Oriented Programming Sumathie Sundaresan CS590 :: Summer 2007 June 30, 2007.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University IWPSE 2003 Program.
Software Engineering Lecture 6 Vladimir Safonov, Professor, head of laboratory St. Petersburg University WWW:
Aspect.NET — aspect-oriented toolkit for Microsoft.NET based on Phoenix and Whidbey Dmitry Grigoriev, PhD student Vladimir O. Safonov, Senior Member, IEEE,
Software Engineering Lecture 7
Presentation transcript:

Aspect.NET – an aspect-oriented programming tool for Microsoft.NET Vladimir O. Safonov Professor of computer science, Head of laboratory St. Petersburg University

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET project (granted by MSR in 2002 and 2004) Goals : Develop a state-of-the-art aspect-oriented programming (AOP) tool for Microsoft.NET, on top of Microsoft Phoenix, integrated with the latest Visual Studio (Whidbey) and working also in SSCLI/Rotor environment Make AOP ubiquitous for Microsoft.NET software developers Develop most adequate ways of representing aspects for Microsoft.NET Lay the foundation for future research and development work on spreading AOP among Microsoft.NET users

Vladimir Safonov, SSCLI Capstone Workshop, Redmond AOP origin and status Aspect-oriented programming (AOP) – a prospective software engineering paradigm based on a concept of cross- cutting concern whose implementation contains not only a related set of modules (generalized procedure), but also a set of tangled code fragments to be woven (inserted) into a target application Predecessor: Professor A. L. Fouxman (Rostov University, Russia), Technological Aspects of Software Systems Development, 1979 Modern classicist of AOP: Professor Gregor Kiczales, University of British Columbia, Canada (AspectJ tool ~ AOP extension for Java)

Vladimir Safonov, SSCLI Capstone Workshop, Redmond AOP basics Cross-cutting concern ~ a concern whose implementation cannot be made by a generalized procedure Examples ~ logging; security; MT-safety; implementation of a new source language construct in a compiler Aspect ~ implementation of a cross-cutting concern Weaving ~ applying an aspect to a target application (inserting new modules and definitions; inserting, replacing or deleting tangled pieces of code) Pointcut ~ a set of weaving rules for an aspect Join points ~ a set of concrete points in a target application subject to aspect weaving Benefits of AOP: make software development and maintenance easier, due to performing it in terms of aspects

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Our approach to AOP Make aspects multi-language (language agnostic), in accordance to.NET programming paradigm, as opposed to extending any concrete programming language by AOP constructs (as in AspectJ) Use a simple AOP meta-language Aspect.NET.ML to provide user-level AOP annotations to source code of compilation units Represent meta-information on aspects by custom attributes (AspectDef, AspectRef), to safely tie them to assemblies, to make them easily available to AOP tools, and to avoid updating any general.NET tools for the purpose of their AOP-awareness Use Phoenix to handle assemblies and to support weaving Develop Aspect.NET as a Whidbey add-in to closely integrate it to Microsoft.NET development tools, technologies and environments

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Compare to other approaches to AOP Language extensions of a specific (usually – Java) language for AOP (AspectJ) Multi-dimensional separations of concerns (IBM HyperJ) Interceptors XML files with AspectJ-like specifications (Weave.NET) Dynamic aspects (similar to debugger breakpoints) Our approach is easy-to-use, language-agnostic, and integrated with the latest Microsoft technologies and tools (Whidbey and Phoenix) As far as we can judge, right now there is no other AOP tool so closely integrated to Microsoft development tools as our Aspect.NET

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET architecture Aspect.NET.ML converters (currently for C#) to definitions of AspectDef AOP attribute Aspect weaver: Target assembly + Aspect assemblies -> Target assembly* Aspect editor + aspect GUI: locating aspects, coloring aspects, editing aspects, deleting aspects; integrated to Whidbey as add-in Aspect.NET.msi-based installer (checks where the Phoenix RDK is located on your machine) AspectRotor – a separate console version of Aspect.NET for Rotor environment

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Example: the Politeness aspect % aspect Politeness public class Politeness { %modules public static SayHello () { System.Console.WriteLine(Hello); } public static SayBye () { System.Console.WriteLine(Bye); } %rules %before %call * %action public static void SayHelloAction { Politeness.SayHello()} %after %call * %action public static void SayByeAction { Politeness.SayBye()}

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Example: Weaving Politeness %to MyApplication %apply Politeness (the same can be done by means of Aspect editor)

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET working screenshot

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect coloring screenshot

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET status and perspectives Aspect.NET implementation team (SPBU PhD and graduate students: Dmitry Grigoryev, Mikhail Gratchev, Alexander Maslennikov, Oleg Romashin.) A working prototype of Aspect.NET on top of latest Phoenix (02/28/05) and Whidbey beta2 developed Aspect.NET installer/distribution developed Working console version of Aspect.NET for Rotor environment (AspectRotor) developed Aspect.NET uploaded to MSDNAA Curriculum Repository Web site Perspectives: library of examples; further research on aspect- oriented knowledge management and on aspectizing (aspect mining) Our desire is to get funding from Microsoft to continue our project, to make Aspect.NET a product to be shipped with the future versions of Visual Studio.NET

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Conferences and seminars where Aspect.NET project presented First MSR Rotor Workshop, Cambridge, July 2002 Rotor Workshop, University of Pisa, Italy, April 2003 Fault-tolerant Software and Hardware Systems Workshop, Hasso-Plattner Institute, Potsdam, February 2004 Microsoft Academic Days, Moscow, April 2005 IEEE Regional Conference, St. Petersburg, May 2005 MSR Faculty Summit, Redmond, July 2005 (as part of the Phoenix panel) Now MSR Rotor Capstone Workshop, Redmond, September 2005 Current plans (Sep 2005): submit a paper and talk on Aspect.NET to the Fifth International AOSD Conference, Bonn, Germany, March 2006 (the classical AOP conference)

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET users, evaluators and those who sent feedback (Sep 2005) Microsoft Phoenix team – John Lefor, Shahrokh Mortazavi, Jim Hogg et al. Mercury Interactive ( contact person: Yaniv Bronstein University in Brazil, contact person: Andrea Furtado Highly appreciated the project ( feedback): Andreas Mauer, TRIA IT-consulting GmbH ( John Fahring

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET teams creative contacts to other AOP R&D teams Gregor Kiczales, University of British Columbia Andreas Polze, Hasso-Plattner Institute, Potsdam, Germany Mark Eaddy, Professor A. Ahos AOP intern in Phoenix team Donal Lafferty, Trinity College, Dublin, Ireland (Weave.NET project) Tihamer Levendovsky, Budapest Technical University, Hungary Andrea Furtado, University in Brazil

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Aspect.NET references 1) - The starting Web site on AOP 2) – Aspect.NET&doc 3) Safonov V. O. Aspect.NET: a new approach to aspect-oriented programming. -.NET Developers Journal, 2003, #4. 4) Safonov V.O. Aspect.NET: concepts and architecture. -.NET Developers Journal, 2004, #10. 5) Safonov V.O., Grigoryev D.A. Aspect.NET: aspect-oriented programming for Microsoft.NET in practice. -.NET Developers Journal, 2005, # 7. 6) Safonov V.O., Grigoryev D.A. Aspect.NET – an aspect- oriented programming tool for Microsoft.NET. – Proceedings of St. Petersburg Regional IEEE conference, St. Petersburg, May 2005.

Using Aspect.NET Vladimir O. Safonov Professor St. Petersburg University

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Installing Aspect.NET Pre-requisites: 1) Microsoft Visual Studio 2005 beta 2 installed. 2) Microsoft Phoenix RDK 02/28/05 Release installed Notes: Aspect.NET Framework has been tested under Microsoft Visual Studio 2005 beta 2 and with assemblies written in C# only. To install Aspect.NET, run AspectNETFramework.msi and follow tips of the wizard. The installer copies core assemblies, deployment files as well as Phoenix binaries into the folder specified by the user.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Starting Aspect.NET Framework The Aspect.NET Framework add-in window appears every time Visual Studio is started.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond How to create an aspect in Aspect.NET ML? Aspect is a special VS C# project template. So, please create a new project (say MAddNopCounter) specified with aspect template.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond How to create an aspect? The wizard generates the simple aspect skeleton in aspect.an file, which is container for aspect description written in Aspect.NET ML. Сode the body of the aspect in the.an file, based on the skeleton generated by the wizard.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond How to create an aspect? Click Build Solution button or executeRebuild All. At this phase, the aspect.an.cs file is created to contain correct C# source code with ML annotations converted into the custom attribute AspectDef. Then, the standard C# compiler compiles it to the aspect assembly and places it into the debug folder (say MAddNopCounter.dll). One can weave this assembly as an aspect to his/her projects.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Weaving aspects Open or Create new C# project in Visual Studio. In Aspect.NET Framework click "Add Existing Aspect Module" button on "Modules" tab to add Aspect assemblies. You can add multiple assemblies. Press "Find Joinpoints" button to find the join points in the currently active project. If join points have been found, Aspect.NET Framework switches to the "Aspects" tab. Here you can filter the joinpoints and browse them.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Weaving aspects Use the checkboxes in the join points tree to enable or disable a join point. You can enable or disable groups of join points by checking or unchecking parent methods, classes and namespaces. You can click the join point to see its location in a source code. Pressing "Weave Aspects" button results in aspects weaving into the debug assembly of the current project. When weaving is finished, Aspect.NET Framework informs you where the target assembly is located.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Weaving aspects Visualization Tab represents program modules, with aspect actions woven, as colored chart.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Example of Weaving MAddNop is a basic sample included into Phoenix RDK to demonstrate its capabilities. It is a simple managed Phoenix based application to add nop's to an existing executable. Lets change its behavior without touching source code and create an aspect MAddNopCounter to add some tracing. The aspect reports on starting Phoenix initialization process, prints Phoenix configuration state and counts the number of nops inserted to an executable.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET Turn the MAddNop.cs file from \PhoenixRDK\src\Samples\maddnop into VS project named MAddNop. Lets weave our aspect to MAddNop project and check the results.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET First of all load the source project into VS IDE.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET Load the MAddNopCounter assembly to the Aspects list.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET Click Find Joinpoints button and wait until the obtained points will not be printed at Aspects tab.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET To weave the actions to the join points, click Weave Aspects button and check the resulting assembly ~MAddNop.exe in the debug folder of your project. Lets try how it works on the testapp.exe shipped with PhoenixRDK. Copy testapp.exe and testapp.pdb from \PhoenixRDK\Applications\Tests into debug folder of MAddNop project. Run ~MAddNop.exe testapp.exe newapp.exe andMAddNop.exe testapp.exe newapp.exe in the console to compare the behavior of the assembly with the aspect woven to that of the original assembly.

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Step by Step playing with Aspect.NET The result of executing two assemblies is presented below. As we can see, output of our new assembly is much more informative, as compared to the original assembly. No Phoenix source code touched to achieve this goal

Vladimir Safonov, SSCLI Capstone Workshop, Redmond AspectRotor The first Aspect.NET console version working in the Rotor environment. Included into the Aspect.NET archive uploaded to the MSDNAA Web site A set of Perl scripts (please use ActivePearl 5.8.7) to initialize, to build and remember target applications and aspects, to select join points, to visualize the sources, to weave aspects, to run the original and the updated assemblies Uses Phoenix as well-as the add-in version, and the Rotor binaries shipped with the Phoenix RDK A simple comfortable menus in console mode provided for each step; its possible to undo and return back DEMO (IF TIME PERMITS…)

Vladimir Safonov, SSCLI Capstone Workshop, Redmond Q & A