Ideas:chad3f:RPFramework: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>Chad3f
imported>Chad3f
Line 39: Line 39:
This has the following problems/short-comings:
This has the following problems/short-comings:


- It requires the generate methods to be explicitly called from some initialization code. The was an actual stendhal problem were several generateRPClass() methods were defined, but never called.
* It requires the generate methods to be explicitly called from some initialization code. The was an actual stendhal problem were several generateRPClass() methods were defined, but never called.


- The generate methods have to be called in the proper order. This requires the initialization code to know the implementation details (at least the class tree) of the RPClass's that it's configuring. As a result, unnecessary code-coupling is formed. If it is done wrong, or the heirarcy changes after the fact and nobody thinks to check those fragile dependancies, it could break.
* The generate methods have to be called in the proper order. This requires the initialization code to know the implementation details (at least the class tree) of the RPClass's that it's configuring. As a result, unnecessary code-coupling is formed. If it is done wrong, or the heirarcy changes after the fact and nobody thinks to check those fragile dependancies, it could break.


- The parent RPClass is assigned after creation [via isA()], so there's the chance it could be missed. Or worse yet, called twice with different parents (that could have some nasty unexpected effects).
* The parent RPClass is assigned after creation [via isA()], so there's the chance it could be missed. Or worse yet, called twice with different parents (that could have some nasty unexpected effects).


- The assigned parent is typically assigned by name, rather than object, which can make it prone to spelling errors. If you're lucky, it will throw an exception, if not a hard to track problem may arise. Also passing the name means a common base class has to be resolved several times.
* The assigned parent is typically assigned by name, rather than object, which can make it prone to spelling errors. If you're lucky, it will throw an exception, if not a hard to track problem may arise. Also passing the name means a common base class has to be resolved several times.


=== Proposed Replacement ===
=== Proposed Replacement ===