From: Ben S. <bs...@vr...> - 2002-05-30 21:37:02
|
On Thu, 30 May 2002, Kevin Meinert wrote: > > > > Not a book, but experience. When an object has a property, do you write a > > set/make method pair to manipulate it or a set/get pair? What does the > > industry standard tell you? What does any UML tool use while reverse > > engineering a diagram from the code to determine an object's properties? > > > > might need a get for retrieval. but we know all gets are actually sets... > :) But only as a (sometimes nasty) side-effect. > > and we also know the gets and sets don't return out the back (just because > of how we chose to implement - object oriented C). And I'm suggesting that we don't make that requirement. I'm saying that anything that's manipulating a property on an object should be set/get. ie. Matrix4ff mat; Vec3f v; setTrans(mat, v); v = getTrans(mat); getTrans(mat, v); I would prefer using "get" to having to use "make" for the middle function since this is a common idiom that I and I hope (could be wrong though) most OO programmers are familiar with. I guess I don't see why we should create our own idiom just because we happen to be doing OO in C rather than C++. To me, the language doesn't matter when it comes to naming. > > since you wanted it out the back as temporary, then it is make. I can't > remember what the original issue is anymore. Does this clear it up? I understand how GMTL is currently implemented. Completely clear on that! I realize that currently if i want something out the back of a function I have to use a "make" function. My issue is that I don't feel that this is a good naming convention for the reasons listed before and am trying to show you guys as to why. All I seem to get back from you is a description of how it is currently implemented and that I should use that. Perhaps you could give me a reason as to why it should be implemented that way. > > just write a set( vec, mat ) and a set (mat, vec), and you'll be golden. > if you need a constructor, use "make"... > > The only way to have constructors in C, or the only way to decouple > constructors from C++ objects is to have "make" functions. Is it the > naming you don't like? I don't see the problem I guess... We're not really doing C. We're doing C++ and we DO have constructors. In no way does a "make" function decouple the constructor from the object. > > kevin > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > ggt-devel mailing list > ggt...@li... > https://lists.sourceforge.net/lists/listinfo/ggt-devel > cheers, ----- Ben Scott Research Assistant VRAC bs...@ia... |