Tutorial for LowRA / IOC Plugin 1
For this part, no code it purpose.
How to think in Plugin
First when you make an application, a game or any software, you cut it in some distinct parts. This parts can be define by a visual approach. For us first game we will make a Tic Tac Toe game. And now we search to fitted plugins.
But, what is a plugin ? What can it bring to me ? Who killed Laura Palmer with a plugin ?
There are two goods reasons that can help you to view our game with plugins :
- this part of my application can serve again
- two distinct plugins can be easy develop by two programmers at the same time
Some advantages are in favor of plugin with LowRA (MVC and IOC concept) :
- a plugin have some public events to communicate with others (can be configured by IOC)
- a plugin have some private events to make communication flow beetween each part of the plugin (like MVC conception)
- a plugin have a special channel for debugger to communicate with developer (you can use Air Logger or Flash Inspector)
You can now make a remark, like a Major Briggs Junior : divide for reign.
Where are my plugins baby ?
Like a normal application we identify each functionalities. We need :
- some buttons to start, restart, quit the game etc : control panel
- a thing like a score : score panel
- and the game
Now let’s look how does it work :
- when I launch the game, I want to view the control panel and click to start button
- that’s mind control panel send a message to game for say give a new board for players
- during the game nothing go out of game
- when a winner is detected game say to others noughts or crosses win
- winner’s score is increased in score panel
- control panel purposes to play another game
- and so on ... until quit or bug :p
The Log Lady
It’s wonderful. It will work. So easy, yeah ! Not exactly, it’s missing an important part. We have already thought about what we need. But we never think about : how it agglomerates, which of this part is the main ?
Around Laura Palmer world a lady can tell you : “speak to my log !”
In LowRA world we prefer use Inversion Of Control conception. It consists to create an XML that defines how will work my application, my game, my plugins.
For this, we need to make an assembler which can read the famous XML : applicationContext.xml for instantiate all plugins.
Arg ! who have killed Laura Palmer ?
For now, we just know how to think with lowra in plugins. Next time, we’ll make our first plugin, promised ;)
For any suggestion, remarks : mickael.foucaux@gmail.com
For any correction, make better english : create an account and click [edit] button
For another think about LowRA call Francis Bourre.
projects/lowra/tutorialsiocplugin1.txt · Last modified: 2008/01/23 01:57 by fbourre