Ideas:chad3f:RPFramework: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Chad3f |
imported>Chad3f |
||
| (27 intermediate revisions by the same user not shown) | |||
| Line 90: | Line 90: | ||
In this code, when one of these java classes is loaded, the static initializer will automatically call it's createRPClass() method. If the class has a super-RPClass [such as OtherClass.createRPClass() uses], before the reference to SomeClass.RPCLASS is used, the JVM will have loaded SomeClass and called it's createRPClass(). |
In this code, when one of these java classes is loaded, the static initializer will automatically call it's createRPClass() method. If the class has a super-RPClass [such as OtherClass.createRPClass() uses], before the reference to SomeClass.RPCLASS is used, the JVM will have loaded SomeClass and called it's createRPClass(). |
||
If the parent RPClass is only assignable during the constructor of sub-classes [i.e. normal use of isA() goes away], then it will be more obvious that the parent has been omitted. Of course, someone could always call the RPClass constructor with no parent argument, and still forget the super, unless the only constructor(s) available required the parent, in which case the |
If the parent RPClass is only assignable during the constructor of sub-classes [i.e. normal use of isA() goes away], then it will be more obvious that the parent has been omitted. Of course, someone could always call the RPClass constructor with no parent argument, and still forget the super, unless the only constructor(s) available required the parent, in which case the ''new RPClass(null, "name")'' would be very obvious as having no parent. |
||
| Line 99: | Line 99: | ||
* Compile-time parent checking (look ma' no strings). |
* Compile-time parent checking (look ma' no strings). |
||
* Never having to resolve RPClass's by name (in init code anyway), since the JVM will assign the runtime |
* Never having to resolve RPClass's by name (in init code anyway), since the JVM will assign the runtime constant once, and everything else uses this value. |
||
* No explicit need to force class definition from a common setup class/method, as long as the class containing the RPCLASS constant is referenced before any RPObject instances using that class are bound to their RPClass. And this can be guaranteed if the constant is used when setting the RPObject's class (with the same benefits as RPClass gets). |
* No explicit need to force class definition from a common setup class/method, as long as the class containing the RPCLASS constant is referenced before any RPObject instances using that class are bound to their RPClass. And this can be guaranteed if the constant is used when setting the RPObject's class (with the same benefits as RPClass gets). |
||
---- |
|||
== Message Protocol == |
== Message Protocol == |
||
| Line 107: | Line 110: | ||
''TBW'' |
''TBW'' |
||
---- |
|||
[[Ideas:chad3f|Back to Ideas]] |
|||