Still Plinking Away, The End Game

Well it is time to make a choice! I started with three and took another good look at was available in the MooseX space on CPAN today and didn't see anything else that I think would do what I want. Though I was quite interested in Moose::Templated until I figured out it was a template system for rendering content utilizing roles rather that what I was looking for a template system to create roles and classes.

Anyway back to my choice.

At least it was easy to eliminate MooseX::ClassCompositor as it did not do what I wanted though I could see it use some-where else. To use it I would have to trash a good deal of code and have no 'Base' class just roles. Well AD&D is just a little too static for that but if I had a very large number of characters and classes like in the 5thEd. I might start out that way.

So given that I do have a relatively small and thus manageable set of base classes I think I will have to go with MooseX-AbstractFactory and not MooseX::ShortCut::BuildInstace

Now my main reason for this is I like having that 'Factory Class". It give me a good deal of flexibility as I could create any number of specific Factories such as a Monster or Encounter and that would fit well into game design. I will have to watch out though as I am venturing near anit-pattern land me thinks, however if I keep things in order and keep the number of factories down to a minimum I wont get there.

This is of course not a final decision as BuildInstace had one pattern I liked. It does handle the problem of sub-classes better than the Factory me thinks. Fighters are a good example with two sub-classes 'Ranger' and 'Paladin'. It is only two easy to add in the extra roles for these two classes when creating from a fighter and presto there you have the class in a instance

With the Factory way of doing things I think I am boxed into creating a new class for each of these and or a new Factory for each.

Well time will tell

moose_scat.gif

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations