taskRAF Game Engine - Tasks: task #4759, Use interfaces instead of class...

Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

task #4759: Use interfaces instead of class extending

Submitted by:  Srecko Toroman <sreckotoroman>
Submitted on:  Sat Feb 3 20:50:50 2007  
Should Start On: Fri Feb 2 23:00:00 2007Should be Finished on: Fri Feb 2 23:00:00 2007
Category: Core enginePriority: 1 - Later
Status: Need InfoPrivacy: Public
Percent Complete: 0%Assigned to: None
Open/Closed: OpenEffort: 1.00

Sat Feb 3 20:50:50 2007, original submission:

As it is mentioned in many Game programming books, tutorials and articles, we should program to interface, not classes. Also, it is almost impossible to create a good object hierarchy, but with interfaces it is different.

TASK: We should redesign the engine to use interfaces.

Few proposals:

interface Movable {
int linearVelocityX;

interface Drawable {
void draw(...);

interface ITrigger {

[note: give names like "Something"able or like I"Something"]

We should also use composition of objects instead of extending - is the public opinion ;)If we decide that interfaces are better and smarter way to program, then we should also decide what to do with methods defined in abstract classes. Maybe move them to static utility classes? Or let every implementation define them?

CONCLUSION: we need to talk about this more. Game design is very important, and if we continue to program in wrong direction, it may be difficult to refactor the code later. Maybe few (UML) sketches can help.

Srecko Toroman <sreckotoroman>
Project Administrator


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by sreckotoroman (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup