From: Brian R. <bri...@ya...> - 2001-11-20 09:32:32
|
--- Ulrich Eckhardt <doo...@kn...> wrote: > > > > What do you think is the best way to represent > Name? > > > A string should be ok, another overload should take > some kind of small binary > identifier (enum or so). The string would be when I agree with this, but to use an enum will cause us to hard-code all the possible objects into the system, instead of allowing it to vary in real-time. > [use] the binary identifier when it's a perception > coming over the network. I don't understand. This doesn't pertain to Perceptions. Please explain. > Hmmm, if I understand you right, the > BuilderControllers are import-filters > for the various source-formats, while the Builders > are specialized for > building one certain Object-type, aka > export-filters. The Factory stands in > the middle, managing the use of import and export > filters. > Right ? If so, yes I would call it Parser. I think I should send a UML diagram. The ObjectFactory is not between the Builder and BuilderController. > I wonder if we need such high complexity. As I said > above, I see only two > overloads (binary and string) for the input that > creates an Object. That's not too complex (I think). I'll send a UML diagram soon to show that this is not really that complex. > About the structure of the Oject itself, I also had > the same thought > (controller+attributes) but I see a big problem in > that: either you provide a > generalized interface to the attributes > (std::map<string, string> ) or the > controller must be matched with the actual dataset > that it operates with. > The problem is that the generalized way probably > takes lots of time and > memory ... at least something like map<enum, > GenericAttrib*> should be used > instead. I was thinking about this before too. I'm thinking of defining an object that will define this: class RPint { enum type = int; int value = 2; } or for a string: class RPstring { enum type = string; string value = "blah"; } Of course we'll add more than just these. Then it would be easy for the Controller to do work. > However, before we try to build that, I would like > to see the need for it. In > the first run, I would rather use only a few > predefined though limited > Object-types and see how the game goes, and if we > really need more > flexibility, we can add that later. By "predefined" do you mean hard-coded for example: class Sword { private: int damage; int weight; } and class Human { private: int intellegence; int dexterity; } or do you mean in a template file? > As a personal note, I must say that I once wrote The > Perfect Flexible > System(tm), it got me some interesting insights but > was never really in use > or useful, just cost my employer a few thousands > .... This is interesting. But to me, flexibility in one of the primary concerns of Arianne. ===== "Teach a man to make fire, and he will be warm for a day Set a man on fire, and he will be warm for the rest of his life." - John Hrastar __________________________________________________ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 |