Skip to main content
GameDev.net gamedev.net
🔒 Locked

Handle Class or Protocol Class

Started by TEUTON Sep 11, 2006 at 9:04 PM 3 replies 1.2k views
Original Post
TEUTON
TEUTON
In Effective C++, 2nd Edition Scott Meyer tells two ways( i.e Handle Class and Prototcol Class) to minimise compilation dependencies between files(Item34). But I wanted to know when should I prefer one over other to reduce compilation dependencies? Should I always stick with Handle Class or should always stick with Protocol class? Are there any guidelines? [Edited by - TEUTON on September 11, 2006 9:41:49 PM]
TEUTON
TEUTON
*bump*
JohnBolton
JohnBolton
If the sole purpose is to reduce compilation dependencies, then in my opinion you should use neither. Both have major drawbacks in that they increase the complexity of the code a lot.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
JohnBolton
JohnBolton
I don't have the book either, but from what I read here: The Code Project: How to prevent unnecessary compilation of source files, it seems that the Handle class uses the bridge pattern, and the Protocol class uses the bridge pattern with a factory method. That's what I based my opinion on, though I could be wrong.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.