Simple Components

XNA Framework provides the simple task mechanism whose name is “GameComponent”. I did not understand the concept of this class at first. GameComponent is very simple and is not better than various task systems that I have seen. I thought that this class is just utility class for beginners.

But, now, I understand the merit of this class design a little.

The GameComponent has only minimum methods — Initialize, LoadResouce, UnloadResouce, Update, Draw, Dispose and some events… These methods are fundamental process that all classes need. So, sub-classes of GameComponent are always exportable for other projects.

When a developer defines exchangable components, he tries to write helpful mechanism for rapid development. But, a class having many methods needs discussions, because it has extra features which are not must to exchange.

A class which is pure for its goal does not have extra methods, even if it looks poor.

This entry was posted in XNA. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s