Stendhal code design: Difference between revisions

From Arianne
Jump to navigation Jump to search
imported>Chad3f
imported>Chad3f
(No difference)

Revision as of 01:21, 26 April 2007


Client

Entities

Entity's are created using EntityFactory.createEntity(). In this method, the appropriete implementation class is created, and the initialize() method is called. When the entity is to be removed, the release() method should be called on it.

The design is being transitioned to a Model-View-Controller (MVC) like framework. This will allow different visual implementations (like 2D, 3D) to be plugged in with minimal (or no) changes of the model class.

Example:

RPObject object = ...

Entity entity = EntityFactory.createEntity(object);

// Force the view to be created
entity.getView();

  ...

// Done with entity - free up resources
entity.release();

Sound System

Server