barname_nevisiye_janbe_gera

در نمایش آنلاین پاورپوینت، ممکن است بعضی علائم، اعداد و حتی فونت‌ها به خوبی نمایش داده نشود. این مشکل در فایل اصلی پاورپوینت وجود ندارد.






  • جزئیات
  • امتیاز و نظرات
  • متن پاورپوینت

امتیاز

درحال ارسال
امتیاز کاربر [0 رای]

نقد و بررسی ها

هیچ نظری برای این پاورپوینت نوشته نشده است.

اولین کسی باشید که نظری می نویسد “Aspect Oriented Patterns”

Aspect Oriented Patterns

اسلاید 1: Aspect Oriented Patternsمحمد مهدی طالبیدانشگاه صنعتی امیرکبیر (پلی تکنیک تهران)پاییز 89- چند ساعت قبل از شب یلدا

اسلاید 2: 2اتاریخچه برنامه نویسی جنبه گرا اولین بار توسط گريگور كيزالس (پروفسور دانشگاه UBC )، در کشور هلند مطرح شد .اولين ارائه رسمي از اين موضوع طی مقاله ای در یک کنفرانس اروپایی در رابطه با برنامه نویسی شئ گرا تحت عنوان ” Aspect-oriented programming“ طی سال 1997 مطرح شد . G. Kiczales, J. Irwin, J. Lamping, J.-M. Loingtier,C. Lopes, C. Maeda, and A.Menhdhekar. Aspect-oriented programming. In M. Ak¸sit and S. Matsuoka, editors, Proceedings of the European Conference on Object-Oriented Programming, volume 1241, pages 220–242, Berlin, Heidelberg, and New York, 1997. Springer-Verlag.به تدریج با افزایش اقبال به سمت این تفکر AspectJ به وجود آمد ، که از برنامه نویسی جنبه گرا حمایت میکرد .

اسلاید 3: 3منابع[1] Kiczales, G. and Mezini, M. 2005. Aspect-oriented programming and modular reasoning. In Proceedings of the 27th international Conference on Software Engineering (St. Louis, MO, USA, May 15 - 21, 2005).[2] Lippert, M. and Lopes, C. V. 2000. A study on exception detection and handling using aspect- oriented programming. In Proceedings of the 22nd international Conference on Software Engineering (Limerick, Ireland, June 04 - 11, 2000). [3] Noura El Maghawry, Ahmed R.Dawood. Aspect Oriented GOF Design Patterns .In Proceedings of the The 7th International Conference on Informatics and Systems (INFOS), 2010 .[4] Jan Hannemann and Gregor Kiczales. 2002. Design pattern implementation in Java and aspectJ. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA `02).[5] Eduardo Kessler Piveta and Luiz Carlos Zancanella. Observer Pattern using Aspect-Oriented Programming. In Proc. of the 3rd Latin American Conference on Pattern Languages of Programming, Porto de Galinhas, PE, Brazil, August 2003.[6] Radoslav Menkyna. Towards combining aspect-oriented design patterns.In M´aria Bielikov´a, editor, Proc. Informatics and Information Technologies Student Research Conference, IIT.SRC 2007, pages 1–8, Bratislava,Slovakia, 2007.[7] Miles, R.: AspectJ Cookbook. O’Reilly, 2004.[8] Bruno Dufour, Christopher Goard, Laurie Hendren, Oege de Moor, Ganesh Sittampalam, and Clark Verbrugge. 2004. Measuring the dynamic behaviour of AspectJ programs. In Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA 04).

اسلاید 4: 4تعاریف اولیهConcernTanglingCross-Cutting Concern

اسلاید 5: 5بررسی قدرت AOP در Exception Handlingدر هر نرم افزاری قسمتی از کد به یافتن خطا و برخورد با آن اختصاص میابد .پروسه به هم آمیختن رفتار معمول و رفتار غیر معمول در برنامه میتواند منجر به پدیده Cross Cutting Concern شود .تفکر AOP میتواند به نحو قابل توجهی حجم کد مربوط به برخورد با خطا را کاهش دهد برای نشان دادن این مطلب به سراغ JWAM Framework رفته و آن را بازنویسی میکنیم [2].JWAM یک Framework است که در دانشگاه هامبورگ آلمان تهیه شد و بعد ها حالت تجاری به خود گرفت و دارای بیش از 600 کلاس میباشد .برای نشان دادن قدرت AOP ، کد JWAM با رویکرد جنبه گرا باز نویسی شد و مشاهده شد حجم کد مربوط به برخورد با خطا به اندازه ¼ کاهش پیدا کرده است.

اسلاید 6: 6ارائه یک مثالClass point {Static bool compare(point p1,pointp2){ if(p1 == null || p2==null ) throw Exception(“Arg Null Exception in Point.Compare”); …. } // end of compare(point p1,pointp2). ..}//end of Class point فرض بگیرید 600 کلاس دارید که هر کدام 20 تابع با آرگومان از نوع Object دارند :12000= 20*600 (تعداد مکان برخورد با خطا )24000= 2*12000 (تعداد خط کد برای برخورد با این خطا )

اسلاید 7: 7ارائه یک مثالClass point {Static bool compare(point p1,pointp2){ …. } // end of compare(point. ...}//end of Class point /************************************<Aspect>******************************************/aspect ExceptionHandler {pointcut HasObjArg(data e, Args *args): execution(void *.*(*)) ) && target(e)before(data e , Args *args) : HasObjArg () {if ( chkArgnull(Args) == true ) throw Exception(“Arg Null Exception in”+e.Name);} }//end of aspect UpdateSignalingPointCutAdviceAspectPoint.*()Point.Set*(int,int)24000  10

اسلاید 8: Exception Introduction PatternFrom the nature of aspects some design pattern can be added to another without the modification of the existing pattern. ( Exception Introduction , Policy )8 Adding pointcut design pattern to an advice design pattern requires usually a change in existing advice pattern.

اسلاید 9: 9بررسی برخی مدل های ارائه شده در کتاب GOFگاهی مجرد سازی به تنهایی قادر به کپسوله سازی Cross Cutting Concern ها نیست. در بسیاری موارد pattern ها با کد اصلی چنان در هم می آمیزند که عملا نمی توان به آنها به عنوان یک ماجول مستقل نگاه کرد.اختلاط کد مربوط به pattern ها باعث میگردد تا اضافه و یا حذف کردن آنها هزینه بر باشد.در پیاده سازی های صورت گرفته از pattern های GOF در 75% موارد افزایش modularity و در 52% موارد افزایش reusability را داشته ایم[4] . Jan Hannemann and Gregor Kiczales. 2002. Design pattern implementation in Java and aspectJ. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA `02).

اسلاید 10: 10پیاده سازی Observer با استفاده از Aspect Oriented Programmingزمانی که از observer استفاده میکنیم باید تغییراتی را در کلاس های موجود ایجاد کنیم :Attach Detach Notify

اسلاید 11: ارائه یک مثال interface Observer {void setSubject(Subject s);Subject getSubject();void update();}11interface Subject {void add(Observer obs);void remove(Observer obs);Vector getObservers();Object getData();}

اسلاید 12: ارائه یک مثالpublic class Celsius{ private double degrees; public double getDegrees() { return degrees; } public void setDegrees(double aDegrees) { degrees = aDegrees; } Celsius(double aDegrees){ setDegrees(aDegrees); } } 12public class Thermometer{ private Celsius tempSource; public void setTempSource(Celsius atempSource){tempSource = atempSource;} public Celsius getTempSource(){ return tempSource; } public void drawTemperature(){} }public class CelsiusThermometer extends Thermometer{ public void drawTemperature(){ System.out.println(Temperature in Celsius+ getTempSource().getDegrees()); }}public class FahrenheitThermometer extends Thermometer{ public void drawTemperature(){ System.out.println(Temperature in Fahrenheit:+ (1.8 * getTempSource().getDegrees())+32);}}

اسلاید 13: ارائه یک مثالabstract aspect ObserverPattern {abstract pointcut stateChanges(Subject s);after(Subject s): stateChanges(s) { for (int i = 0; i < s.getObservers().size(); i++) ((Observer)s.getObservers().elementAt(i)).update(); } private Vector Subject.observers = new Vector(); public void Subject.add(Observer obs) { observers.addElement(obs); obs.setSubject(this); } public void Subject.remove(Observer obs) { observers.removeElement(obs); obs.setSubject(null); } public Vector Subject.getObservers() { return observers; } private Subject Observer.subject = null; public void Observer.setSubject(Subject s) { subject = s; } public Subject Observer.getSubject() { return subject; } }13

اسلاید 14: ارائه یک مثالaspect ObserverPatternImpl extends ObserverPattern {declare parents: Celsius implements Subject;public Object Celsius.getData() { return this; }declare parents: Thermometer implements Observer;public void Thermometer.update() { drawTemperature(); }pointcut stateChanges(Subject s): target(s) && call(void Celsius.setDegrees(..)); }14

اسلاید 15: 15پیاده سازی Observer با استفاده از Aspect Oriented Programming

اسلاید 16: 16پیاده سازی Observer با استفاده از Aspect Oriented Programming Concrete Subject Store state information to be used by Concrete Observers. It does not, however, send notifications to its Observers. This responsibility is part of the Observer Pattern role. Concrete Observers Servers as basis to field and method’s introduction performed by the Observer Pattern. Observer Pattern The Observer Pattern is an abstract aspect that encapsulate the behavior of the Observer pattern. The Observer Pattern contains the fields and methods to be included in the classes that are affected by the Concrete Observer Pattern. Concrete Observer Pattern This participant specifies in what situations the Concrete Observers are going to be notified as well as what is going to be executed when the Concrete Observers are notified.

اسلاید 17: 17پیاده سازی Observer با استفاده از Aspect Oriented Programmingاستفاده از تفکر جنبه گرا باعث میشود که بدون آنکه بدنه کلاس ها را تغییر دهید ، بتوانید از مزایای آن استفاده نمایید .استفاده از تفکر جنبه گرا باعث میشود تا کد مربوط به observer از کد اصلی برنامه جدا شود .با استفاده از این روش reusability را افزایش داده ایم زیرا میتوان تنها با تغییر concrete aspect ها از آن برای کلاس های دیگر نیز استفاده نمود.

اسلاید 18: مزایای استفاده از رویکرد جنبه گرا در ObserverLocality : All the code that implements the Observer pattern is in the abstract and concrete observer aspects,none of it is in the participant classes.Reusability : The core pattern code is abstracted and reusable. The implementation of ObserverProtocol is generalizing the overall pattern behavior.Composition transparency : Because a pattern participant’s implementation is not coupled to the pattern, if a Subject or Observer takes part in multiple observing relationships their code does not become more complicated and the pattern instances are not confused. Each instance of the pattern can be reasoned about independently.(Un)pluggability : Because Subjects and Observers need not be aware of their role in any pattern instance, it is possible to switch between using a pattern and not using it in the system.18

اسلاید 19: بررسی برخی موارد خاص Multiple inheritance and Java : some of the patterns make use of multiple-inheritance in their implementation . The open class mechanism in AspectJ provides us with a more flexible way of implementing these patterns, as it allows to attach both interfaces and implementations (code) to existing classes.Breaking cyclic dependencies : In the AspectJ implementation ,the indirection introduced by the ConcreteMediator aspect removes the cyclic dependencies. 19aspectJJava

اسلاید 20: Mediator20

اسلاید 21: Aspect Oriented PatternsWormholeException IntroductionParticipantCuckoo’s EggDirectorBorder ControlPolicyWorker Object Creation21

اسلاید 22: Cuckoos Egg 22Problem You want to override the type of object instantiated on a constructor call to return an object of a different class transparently to the original business logic.

اسلاید 23: DirectorProblem You want to define a set of roles to be implemented by unknown sets of application classes so they can be interacted with generically by an abstract aspect.23

اسلاید 24: Border Control Design 24Problem You want to formally define important regions within your application so your aspects can reuse those definitions to ensure they are only applied in the correct areas.

اسلاید 25: Border Control Design 25public aspect BorderControllerAspect { /** * Specifies the testing region. */ public pointcut withinTestingRegion( ) : within(com.oreilly.aspectjcookbook.testing.+); /** * Specifies My Applications region. */ public pointcut withinMyApp( ) : within(com.oreilly.aspectjcookbook. myapp.+); /** * Specifies a third party source code region. */ public pointcut withinThirdParty( ) : within(com.oreilly.aspectjcookbook.thirdpartylibrary.+); /** * Specifies the applications main method. */ public pointcut withinMyAppMainMethod( ) : withincode(public void oreilly.myapp.MyClass. main(..)); }pointcut regionsOfInterest( ) : BorderControllerAspect.withinMyAppMainMethod( ) || BorderControllerAspect.withinThirdParty( ) || BorderControllerAspect.withinTestingRegion( );.

اسلاید 26: Combination Of Aspect PatternsAspects usually alter behavior of base concerns without requiring awareness on their side. This makes the combination of aspect-oriented design patterns easier than the combination of object oriented design patterns is.26

اسلاید 27: BenchMarksQuick SortChecking for return of nullVisitorStrategyBean27

اسلاید 28: Checking for return of null28

اسلاید 29: checking for return of null29

اسلاید 30: Visitor30

اسلاید 31: Strategy31

اسلاید 32: AOSD-Europe32

اسلاید 33: 33منابع[1] Kiczales, G. and Mezini, M. 2005. Aspect-oriented programming and modular reasoning. In Proceedings of the 27th international Conference on Software Engineering (St. Louis, MO, USA, May 15 - 21, 2005).[2] Lippert, M. and Lopes, C. V. 2000. A study on exception detection and handling using aspect- oriented programming. In Proceedings of the 22nd international Conference on Software Engineering (Limerick, Ireland, June 04 - 11, 2000). [3] Noura El Maghawry, Ahmed R.Dawood. Aspect Oriented GOF Design Patterns .In Proceedings of the The 7th International Conference on Informatics and Systems (INFOS), 2010 .[4] Jan Hannemann and Gregor Kiczales. 2002. Design pattern implementation in Java and aspectJ. In Proceedings of the 17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA `02).[5] Eduardo Kessler Piveta and Luiz Carlos Zancanella. Observer Pattern using Aspect-Oriented Programming. In Proc. of the 3rd Latin American Conference on Pattern Languages of Programming, Porto de Galinhas, PE, Brazil, August 2003.[6] Radoslav Menkyna. Towards combining aspect-oriented design patterns.In M´aria Bielikov´a, editor, Proc. Informatics and Information Technologies Student Research Conference, IIT.SRC 2007, pages 1–8, Bratislava,Slovakia, 2007.[7] Miles, R.: AspectJ Cookbook. O’Reilly, 2004.[8] Bruno Dufour, Christopher Goard, Laurie Hendren, Oege de Moor, Ganesh Sittampalam, and Clark Verbrugge. 2004. Measuring the dynamic behaviour of AspectJ programs. In Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA 04).

اسلاید 34: 34با تشکر؟

اسلاید 35: 35Lemos, O. A., Ferrari, F. C., Masiero, P. C., and Lopes, C. V. 2006. Testing aspect-oriented programming Pointcut Descriptors. In Proceedings of the 2nd Workshop on Testing Aspect-Oriented Programs (Portland, Maine, July 20 - 20, 2006). WTAOP 06. ACM, New York, NY, 33-38. DOI= http://doi.acm.org/10.1145/1146374.1146380

18,000 تومان

خرید پاورپوینت توسط کلیه کارت‌های شتاب امکان‌پذیر است و بلافاصله پس از خرید، لینک دانلود پاورپوینت در اختیار شما قرار خواهد گرفت.

در صورت عدم رضایت سفارش برگشت و وجه به حساب شما برگشت داده خواهد شد.

در صورت نیاز با شماره 09353405883 در واتساپ، ایتا و روبیکا تماس بگیرید.

افزودن به سبد خرید