Skip to main content
gamedev.net
🔒 Locked

components

Started by cNoob Aug 2, 2007 at 9:19 PM 1 replies 1.6k views
Original Post
cNoob
cNoob
What is component-oriented programming? Contemporary software design increasingly relies on software components in the form of self-contained and self-describing packages of functionality So are components class's and structures for example the console class, is that a component?
Xai
Xai
components (in the .NET sense) are reusable BINARY chunks. For instance a photoshop plugin could be called a component.

If I write an object-oriented game engine, I might have all sorts of cool polymorphic classes for stuff like the OpenGL rendering pipeline and the DirectX rendering pipeline, the OpenAL sound class wrappers and the DirectMusic class wrappers, and some cool configuration ability to pick between them and have some factory system construct the right objects.

If I write a COMPONENT oriented game engine I would have all sorts of cool subsystem INTERFACES, which could in theory be implemented by various other classes ... and then I might write a OpenGL rendering library as a component, and a DirectX one, an OpenAL sound component and a DirectMusic one.

The core arangement is almost the same, the usage is almost the same ... but the component-oriented systems focuses not on reusing implementation, but on defining good interfaces. And then usually packaging implementations up in a more plugable binary way.

So I might have one big monolithic app that had 500 classes, of which only 200 are used in any given configuration ... and call it OO.

But in a component oriented system I'd seperate those 500 classes into seperate assemblies ... and then other apps might reuse only the assemblies they need.

No need for the next project to recompile the OpenGL renderer, it can just reference it the same way you reference the .NET XML assemblies, or the .NET Web Controls.

Compiled chunks that are usable completely as is.
cNoob
cNoob
Ah OK so I was wrong and components are more like the mscorlib dynamic link libary and the system.windows.forms dll etc...

If so I think I understand what a component is now thank you Xai, great help[smile]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.