Upload
jessamine-menachem
View
37
Download
5
Embed Size (px)
DESCRIPTION
Aspect-Oriented Design of Game Application. H. Saygın Arkan, Murat Açar, Ender Demirkaya 30 December 2010. - Outline. Introduction About Aqua Bubble Object-Oriented Design Applied Patterns Problem Statement Aspect-Oriented Programming Related Work Discussion Conclusion Demo. - PowerPoint PPT Presentation
Citation preview
H. Saygın Arkan, Murat Açar, Ender Demirkaya30 December 2010
Introduction About Aqua Bubble Object-Oriented Design Applied Patterns Problem Statement Aspect-Oriented Programming Related Work Discussion Conclusion Demo
2
The game at issue is “Aqua Bubble”
The requirements are in hand.
Limited Project◦ But good start for Aspect Application
Enhancements to the Project◦ Create & Solve Problems
3
Familiar Game◦ Shoot Gun◦ Collect 3 same colored bubbles◦ Balls are moving down
Bubbles are coming down with a certain time period.
The time it takes to move decreases with the increasing number of levels
Purpose: Finish all the balls before they came in the turret’s level.
4
Some sample screenshots...
5
Already distributed responsibilities to packages, thereby classes
UI includes menu panels and visual items as usual.
Controller does the main operation behind.
6
Two main packages:
7
•The package diagram is as follows:
8
•Ui package class diagram
9
•Controller Package class diagram
Singleton pattern◦ GameFrame, GameEngine, GamePanel and
ControllerFacade, InGameFacade Facade pattern
◦ Deals with in-game managers as a one-stop solution
Abstract Factory pattern◦ Creation of balls in game is the subject entry
Strategy pattern◦ Balls have specific explosion types.Strategy
smells
10
Singleton Pattern
11
Exactly one instance is necessary and sufficient
12
Facade Pattern
Abstract Factory Pattern◦ Different balls in game are the factory products
13
Strategy Pattern◦ For different type of explosions that the balls
have.
14
Context ClassContext Class
Interface ViewInterface View
+ findExplosion(ball: Ball)
+ findExplosion(ball: Ball) + findExplosion(ball: Ball)
+ findExplosion(ball: Ball) + findExplosion(ball: Ball)
High coupling & Low Cohesion
Enhancements = Tangling Code and Crosscutting concerns.
Sound affects are to be happened instantaneously.◦ Will we define sounds for each and every UI object
individually?
Logging mechanim crosscuts at all times.◦ Where are the logs of error handling and in-game controls to
be kept?
Some game add-ons are to be integrated.◦ Additional code to all the classes. What a disaster!
15
SoundEffect Concern◦ Panel changes, button clicks, ball explosion...
Costly without Aspect, needs update & modification on all button listeners, panel change functions and the related classes.
Logging Concern◦ Tracing all the process from beginning to the end.◦ Provides effective error handling◦ More controllable game process
16
GameAddOn Concern◦ Functionalities that recurred to the mind.
Graying the panel when game finishes (updating all objects behind)
Changing Ball Colors (gradient, more colorful)
AWTEnforcement Concern AWT use is strictly forbidden.
17
Sound Effects Aspect Sound Effects Aspect is applied to Panel Changes, Button Clicks, Ball Explosions and Level Ends
18
Logging Aspect Logging Aspect is applied to the set functions,constructor calls and panel changes.
19
Game Add-On Aspect Game Add-On Aspect is applied to change the color of all balls to dark gray when the level is finished. Also, ball types shall be re-drawn with different ball images
20
Game Add-On AspectGame Add-On Aspect
21
Previous implementationNew implementation
Game Add-On AspectGame Add-On Aspect
22
Previous implementationNew implementation
AWT Enforcement Aspect AWT Enforcement Aspect ensures that the project keeps it’s package structure. Thus, only UI package classes would use java.awt library and the use of AWT classes in Controller package is prevented
23
Inside AspectJ documentation, there exists a computer game named Space War by which
we are inspired.
After, we went beyond and made some core changes in the project, such as sound effects and changing the image of bubbles in the game.
24
AOP stepped into the breach
Aspect discovery and refactoring are the bottlenecks as per usual.
Legacy code, aspect mining has vital necessity all along the migration process.
Manual examination of aspect candidates.
AspectJ is a useful to track pointcuts, weaving etc.
25
The transition process of a non-modular application into a well-defined aspect-oriented structure is illustrated.
Almost at all levels that the old design congests, the fresh design pioneers the mechanism.
Shortfalls are attached to distinct aspect mechanisms with reference to the ostensible constraints.
Aspect-orientation is worth applying in the cases where the stakeholders do know much about the current system, and see the initiatory steps of migration process.
26