Re: On the benefits of reflection

Tinco Andringa <[email protected]> Tue, 19 Mar 2013 21:38:21 +0100
Newsgroups gmane.games.devel.sweng
Message-ID <CAGW=8Rq+Yjdd3D6B_v1Fg-aRRc4DZYmJhJ4udyQy9DcRroc75Q@mail.gmail.com>
> And for us, there's also a small amount of reflection needed for our garbage
> collector...
>
> -Doug

You use reflection to implement your own garbage collector? This is C#
right? Does your GC just collect resources that aren't needed anymore
or does it actually do a better job of managing memory etc?

To add to the discussion about benefits of reflection:

Coming from Ruby I'm always looking for ways to make things easier to
express using reflection. I think serialization/deserialization is
just one usecase for this. For example C# is a language that's more
geared towards object oriented architecture than to entity systems,
but using reflection you can generate the code that links your
components together at runtime so there's not a lot of boilerplate
code required for every component.

Sort of related to reflection, recently I made a game as an academic
exercise in javascript using an aspect oriented programming library.
AOP has a similar philosophy of taking separation of concerns to the
next level. It worked out very well, you can have the game engine
drive the views without having any hooks or view related code in the
engine. Granted ofcourse this was a javascript exercise, not at all as
resource constrained as a big console game.
_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com