• Advertisement
Sign in to follow this  

Name this Design Pattern

This topic is 3351 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to think of the name of this programming pattern, but am drawing a blank. Essentially, you use attributes or components and plug them into your classes to define class behavior. So, let's say I had a base Robot class. I could have a whole bunch of components that defined possible behavior, such as 'walking', or 'rolling', or 'fixing', and them I register the appropriate behavior with the right type of Robot. So a WorkerRobot may have 'walking' and 'fixing' attributes. I don't think I have the paradigm entirely right, because I think you typically just iterate through the components and update them -- though it is entirely possible that you could make them publicly available through some sort of component table. So...anyone know the name of this pattern? EDIT: Changed the word paradigm to pattern [Edited by - visage on December 16, 2008 7:27:00 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sounds more like a design pattern than a programming paradigm. This could be either a composite or a decorator pattern.

EDIT:
You could also achieve this with a functional programming language such as Lua.

Share this post


Link to post
Share on other sites
Paradigm was the wrong word, thanks for the correction. Pattern was what I was looking for.

Decorator pattern definitely seems like what I was thinking about. Whether that is specifically it, I don't know ... but it sure seems close enough.

Thanks for the help guys.

Share this post


Link to post
Share on other sites
Quote:
Original post by RobTheBloke
you didn't mean component systems did you?


I knew this sort of system had been discussed on gamedev before. Thank you for reminding me of that resource, my good sir.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement