DOC PREVIEW
UConn CSE 298/300 - Aspect-Oriented Software Design

This preview shows page 1-2-17-18-19-36-37 out of 37 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 37 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Aspect-Oriented Software DesignRecall: What does OO Offer?Classic OO programWhen and How does OO fail?Survey Management ApplicationWhat Occurs at Larger Scale?An Example of Good ModularityAnother Example of Good ModularityAn Example of Poor Modularity …Another Example of Poor Modularity …What are Cross-Cutting Concerns?What is AOSD?Symptoms of Cross-Cutting ConcernsConsider Another ExampleSlide 15Slide 16Slide 17Slide 18Objective of AOSDCombining Cross Cutting ConcernsBenefits of AOSDOther Thoughts on AspectsAspect-Oriented Programming (AOP)Aspects in AOPObjective in Discussing AOPWeaving Process VariesAspectJ™AspectJ applied to a large middleware systemproblems like…the cost of tangled codecrosscutting concernsModularizing Crosscutting ConcernsAspect as a Modular UnitJoin Points and Point CutsAdvices and WeavingAspect-Oriented DefinitionsWeaving AlgorithmSecurity UML -1Aspect-Oriented Software DesignAspect-Oriented Software DesignMotivating the ProblemMotivating the ProblemWhat does OO Offer?When and How does OO Fail?Looking at the Problem Large ScaleLooking at the Problem Large ScaleAspect-Oriented Software Design (AOSD)Aspect-Oriented Software Design (AOSD)Aspect-Oriented Programming (AOP)Aspect-Oriented Programming (AOP)Security UML -2Recall: What does OO Offer?Recall: What does OO Offer?Classes are a Very Good Technique to Modularize the Classes are a Very Good Technique to Modularize the Components of the SystemComponents of the SystemAbstractionClasses and Objects Usually Represent Concepts from the Real World, Abstracting Unnecessary Details.EncapsulationClasses Encapsulate their Behavior into Manageable Units, by Hiding their Implementation to the ClientsClassificationHierarchies Provide a Good way to Organize and Classify ClassesSecurity UML -3Classic OO programClassic OO programSurvey Management exampleSurvey Management exampleConcerns are Separated into Different Classesclass Survey_List { public void Add_Survey_Header(Survey_Header sh) { } public List Survey_Title_Search(String title) { } public void Update_Survey_List() { } public void Delete_Survey_Header(Survey_Header sh) { }}class Survey_List { public void Add_Survey_Header(Survey_Header sh) { } public List Survey_Title_Search(String title) { } public void Update_Survey_List() { } public void Delete_Survey_Header(Survey_Header sh) { }}class Survey_Header { public void Create_Survey_Header() { } public void Add_Question(String q) { } public void Add_Special_Question(String sq) { }}class Survey_Header { public void Create_Survey_Header() { } public void Add_Question(String q) { } public void Add_Special_Question(String sq) { }}class Public_Survey_Results { public List Get_General_Statistics() { } public List Get_Questions() { }}class Public_Survey_Results { public List Get_General_Statistics() { } public List Get_Questions() { }}Security UML -4When and How does OO fail?When and How does OO fail?The Object-oriented Paradigm Provides the Class as The Object-oriented Paradigm Provides the Class as the Main unit to Decompose a Software Systemthe Main unit to Decompose a Software SystemA Good Designer/Programmer can Decompose Fairly A Good Designer/Programmer can Decompose Fairly well the Main Concerns of an Application into Classes well the Main Concerns of an Application into Classes and Hierarchiesand HierarchiesHowever, no Matter how Good is the Design there are However, no Matter how Good is the Design there are still Concerns that Cannot be well Modularizedstill Concerns that Cannot be well ModularizedSound Modeling for One Concern (GUI) may Lead to Poor Modeling for Another Concern (Database)This Leads to:Scattering – Code for Concern is DistributedTangling – Code for Multiple Concerns is Present in Each Abstraction (Class, Method, etc.)Security UML -5Survey Management ApplicationSurvey Management ApplicationA Visual ExampleA Visual ExampleAccess-control Code is Scattered Through Both ClassesEach Class has Tangled both Access-control Code and Domain-specific Code public void Survey_Title_Search(String title) { if (user.canSearch()){ slist.search(title); ...}public void Survey_Title_Search(String title) { if (user.canSearch()){ slist.search(title); ...}public void public void Add_Special_Question(String sq) { if (user.canAddSpecialQuestion()){ Question_List.add(sq); ...}public void public void Add_Special_Question(String sq) { if (user.canAddSpecialQuestion()){ Question_List.add(sq); ...}Security UML -6What Occurs at Larger Scale?What Occurs at Larger Scale?Consider Apache Tomcat as a Set of Abstractions that Consider Apache Tomcat as a Set of Abstractions that Represents its Broad Functionality for:Represents its Broad Functionality for: XML ParsingUML Pattern MatchingLogging of User ActivityMany Other CapabilitiesRepresented Pictorially as:Represented Pictorially as:Security UML -7An Example of Good ModularityAn Example of Good ModularityXML Parsing in org.apache.tomcatXML Parsing in org.apache.tomcatRed shows Relevant lines of codeNicely Located in one box – Well Defined© Copyright 1998-2002 Palo Alto Research Center Incorporated. All rights reserved. ApsectJ.org.Security UML -8Another Example of Good ModularityAnother Example of Good ModularityURL Pattern Matching in org.apache.tomcatURL Pattern Matching in org.apache.tomcatRed shows Relevant lines of codeNicely Located in two boxes – (using inheritance)© Copyright 1998-2002 Palo Alto Research Center Incorporated. All rights reserved. ApsectJ.org.Security UML -9An Example of Poor Modularity …An Example of Poor Modularity …… … is Logging in org.apache.tomcatis Logging in org.apache.tomcatRed Shows lines of code Handle Logging Not in just one placeNot even in a small number of placesJust a Mess…© Copyright 1998-2002 Palo Alto Research Center Incorporated. All rights reserved. ApsectJ.org.Security UML -10Another Example of Poor Modularity …Another Example of Poor Modularity …/* * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source


View Full Document

UConn CSE 298/300 - Aspect-Oriented Software Design

Documents in this Course
Java Tool

Java Tool

58 pages

Load more
Download Aspect-Oriented Software Design
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Aspect-Oriented Software Design and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Aspect-Oriented Software Design 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?