Stendhal code design: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann |
imported>Kymara m spelling etc |
||
| Line 8: | Line 8: | ||
=== Entities === |
=== Entities === |
||
Entities are created using '''EntityFactory.createEntity()'''. In this method, the appropriate implementation class is created, and initialized. |
|||
'''Example:''' |
'''Example:''' |
||
| Line 25: | Line 25: | ||
The design is being |
The design is being changed to a Model-View-Controller (MVC) like framework. This will allow different visual implementations (like 2D, 3D, 4D?) to be plugged in with minimal (or no) changes of the model class. |
||
| Line 33: | Line 33: | ||
The '''initialize()''' method is called with the RPObject that it will represent. This method is called after the constructor returns, but before anything else is [externally] called. |
The '''initialize()''' method is called with the RPObject that it will represent. This method is called after the constructor returns, but before anything else is [externally] called. |
||
When the client no longer needs the entity, it should call '''release()''', which should |
When the client no longer needs the entity, it should call '''release()''', which should handle any cleanup, where garbage collection only would be insufficient. |
||
The class gets notified of object changes via the '''RPObjectChangeListener''' interface that it implements. This will be called for all changes to |
The class gets notified of object changes via the '''RPObjectChangeListener''' interface that it implements. This will be called for all changes to its object (and immediate slot objects). |
||
Methods |
Methods |
||
| Line 58: | Line 58: | ||
=== UI === |
=== UI === |
||
The user interface (UI) is responsible for bringing together the base client and user interaction. The base class is '''StendhalUI''', and is extended by an |
The user interface (UI) is responsible for bringing together the base client and user interaction. The base class is '''StendhalUI''', and is extended by an appropriate implementation (currently j2DClient). |
||