Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    424137

A thought..

Sign in to follow this  
_the_phantom_

150 views

So, earlier today Washu mentioned that he had a bone to pick with me on IRC, but he never got back to me about what it was, but this did get me thinking about what it could possibly be about and given that my only major comments about design in my journal have been about the OGLWFW I figured it was related to that that.

Now, a few entries ago I talked about a reworking of the interface for version 2.0 and I mentioned avoiding singletons and using a proxy class to access the underlaying window manager.

Well, about 10mins ago it dawned on me; factories!
Its so simple I cant belive I didnt think about it, infact I was virtually there, accept I was going via a class when a simple GetWindowManager() factory function would do the job of managing the object.

Ofcourse, while this allows for the user to call the window manager into existance anywhere it does bring with it a whole host of problems with window handles, which are infact just ints. In theory one part of the program could make a window and get its handle and have another part destory it without the first part knowing, leading to all kinds of fun bugs to track down.

Which brings me back to the idea of a proxy class of some sort, to act as the window handle and allow some safety, there is probably a pattern which will let me do that.

I'm starting to wonder if I'm suffering from a case of over engineering, trying to prevent too many problems instead of just going with a simple 'dont do this, it'll break it' in the docs method.

All this talk of factories and proxies also plays havoc with my idea I had to use templates and polices to define how bits of the code react (from how it recovers from errors to how it handles the events which accure).

Some more thought and alot of diagrams could be needed here I think, work out what I want todo and how I'm going todo it.... still, I wander what Washu wanted *chuckles*
Sign in to follow this  


2 Comments


Recommended Comments

Reference counted handles.

Although I still can't remember what it was I was going to hit you for...

Share this comment


Link to comment
hmmm Reference counted handles.. yes, thats probably where I would have ended up anyways, cheers [smile]

and I wouldnt worry about forgetting why you were going to hit me, chances are I'll do something else to give you reason todo so at some point [grin]

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!