December 5, 200619 yr Commercial Member What advantage would that be?I really can't think of any. Ed Wilson Mindstar AviationMy Playland - I69
December 6, 200619 yr Our rather large project, an FMS, requires it for OO design reasons, reduces complexity, improves maintainability, improves performance, reduces storage requirments, and allow us to do what we need to do.Anyway, my point was just that if your design calls for static Gdi+ stuff, the technique above won't work, and I wanted to document that fact for those that might otherwise not understand why things weren't working for them as it is not obvious.If you don't see a need for them, by all means reduce your complexity and don't use them.
December 6, 200619 yr Commercial Member I think ya misunderstood my post.You said "The advantage to having static colors, pens, and brushes made it worthwhile for me to figure out how to do it."I simply wanted to know what advantages were offered using static colors, pens and brushes. Your post nicely explains why you must use them... though... gotta say your post has something amusing in it... and I am NOT pointing this out as a slight or a dig, just a 'ha-ha' funny. ;)In your first sentence you say it 'reduces complexity'... in the last sentence you suggest not using them to 'reduce complexity'. Now I know what you mean... but it's still amusing to my simple little mind. ;) Ed Wilson Mindstar AviationMy Playland - I69
December 6, 200619 yr Ed,Yeah, I thought you would notice that and not get my context.To be more precise, I should say that it reduces complex in the code (although for me it was complex to figure out initially). It does this the way any static var does, and I won't bother to explain something so basic here (which I'm confident you likely understand anyway). For those who want to know more, I highly recommend working through Headstart Design Patterns (it's in Java, but you can translate), and C++ Primer 5th Edition.And what I'm saying, is that if it only introduces complexity for others because they don't need it, then clearly it is not advantageous.I just prefer coding the way something should be designed (which is not to say that every design should use them), rather than limiting myself because I can't figure out how to do it. But then, with all of us helping each other with how to do things, we can take some of the sting out of learning them. I'm more than willing to share how to do this if someone determines they need them. That's why I posted my singleton class.Perhaps someone will improve upon my start as well. My hope is that Benchmark will soon have a sourceforge site up were some useful classes will be posted for others to use and contribute too.Sorry, I'm just so busy coding that I didn't bother to be more precise.
Create an account or sign in to comment