Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Component oriented design
08-06-2010, 04:20 PM,
#3
 
I think there is no need to have a base class for the components. We could have a bunch of concrete component "managers".

class ComponentManager
{
public:
template <class T>
shared_ptr<T> get(const Load<T> & loader);
private:
Manager<Texture> textures;
Manager<Model> models;
...
};

The component itself could be a simple struct. The loader class implements loading logics. Hmm... the concrete loaders will still have to implement a common interface.

The motivation for the component based aproach for me has been to get rid of the gigantic interfaces of car, cardynamics. I think the car doesn't have to know that it has got brakes, clutch and a transmission. The driver/input and head-up display could deal(communicate) with this components directly.
Reply


Messages In This Thread
Component oriented design - by NaN - 08-05-2010, 03:27 PM
[No subject] - by joevenzon_phpbb2_import3 - 08-05-2010, 11:14 PM
[No subject] - by NaN - 08-06-2010, 04:20 PM
[No subject] - by joevenzon_phpbb2_import3 - 08-08-2010, 01:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)