Boost logo

Boost :

Subject: Re: [boost] [Mixin] Some comments
From: Borislav Stanimirov (b.stanimirov_at_[hidden])
Date: 2015-01-11 02:59:44


On 11.1.2015 г. 03:05 ч., Klaim - Joël Lamotte wrote:
> On Sat, Jan 10, 2015 at 8:46 PM, Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]> wrote:
>
>>
>> * I have some doubts about the name mixin. What a mixin has more than a
>> facet or an aspect? Mixins in C++ have a specific mean in the context of
>> CRTP. Why have you chosen the mixin name?
>>
>>
> I aree with this remark.
> As I mentionned in previous discussions on this mailing list, it looks far
> more like a "flexible but not performant" implementation the Entity
> Component "pattern".
> Wikipedia: http://en.wikipedia.org/wiki/Entity_component_system
> Explainations about why it's used a lot in game engine code:
> http://gameprogrammingpatterns.com/component.html
>
> Basically allow very flexible composition even at runtime (which helps
> tools dev too).
> It's also have been mentionned in the documentation after these
> discussions. (the doc is actually wrong in thinking that all engines
> component systems rely on inheritance by the way).
>

The types of ecs are briefly mentioned here:
http://ibob.github.io/boost.mixin/boost_mixin/appendix.html#boost_mixin.appendix.app_ecs.nonpoly_ecs

> Last months I have seen mentionned several implemetnations of this pattern
> in C++11/14 on github but was not pleased with any design so far.
> The design of Boost.Mixin is close to what I want but don't reach my needs
> yet (or at least last time I looked at it).
>
>

Yes I remember our discussion from a year ago. Indeed the library isn't
what you need and it's not moving in that direction.

While the library is faster than some similar ones, it is by no means
suitable for heavy performance code where even the cache locality is
important.

Still it could be used in other parts of your program :)

-- snip --

>
>> * The example of the mixin headphones_player show that the play()
>> implementation makes use of get_sound() provided by other mixins. This
>> dependency is not explicit. I would expect to be able to say that
>> headphones_player depends on another mixing providing the get_sound message.
>>
>>
> I believe that there are a lot of better (non game related) example for
> such library.
> A simple 3D space editor allowing to associate behaviours to 3D objects is
> a good enough example and is very simple to visualize mentally.
>
>

That's a very good idea. I may change the example to that (or at least
add such an example) in the near future.

-- Borislav


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk