Original Post
Hi, I've recently started reading up on C#; simultaneously working my way through 3 books - Microsoft Visual C#.Net, Design Patterns in C#, and Managed DirectX 9. I have to say - so far I'm pretty impressed. Coming from a background in mathematical programming (and having been introduced to direct memory management for the first time this year when I started learning C++), I really like the whole C# language. Anyways, a quick few questions. As I go on I'm trying to relate what I read to my current code-base (as far as possible), which is ostensibly C++ (including Boost and Loki), Win32 and OpenGL. So - here goes: Attributes - OK, I get the idea - but what do you actually use them for in practice? Singletons - Singletons are simply implemented in C++, using inheritance from a base-class template (ie Enginuity / GPG), or sticking a class into a seperate pattern tempate (Loki). Is there a simple way to do this in C#, or do you need to add the whole code on a per-class basis? Registration - For example, with object factories. My current resource manager is a single point of contact for all resource requests. At set-up, each seperate manager registers itself with the RM (using an anonymous namespace containing global variables) - this allows me to retain header-independence (which isn't an issue for C#), but, more importantly, allows me to slot in the required managers for any given project just by adding / removing files. The question is : how do I register one class with another in C# in the same way? Thanks for any help, Jim.