I may be missing something, but...
Why not make Module.java implement ModuleEntity directly? This would solve
the problem...
Also I'd rather rename Module to ScarabModule and ModuleEntity to Module
(makes more sense to me), but this is rather Scarab topic than Turbine...
Fedor.
On Sunday 06 May 2001 13:42, you wrote:
> Hey all,
>
> I'm in the process of doing some work on Scarab that is a bit out of the
> ordinary for typical Peer usage and as a result, I'm running into a bad
> assumption that is placed into the code by Torque that will need to get
> fixed eventually... Here is the problem:
>
> In Scarab, there is a SCARAB_MODULE table. This generates a "Module.java"
> which is the business object for the table. Now, the problem is that within
> Scarab, there is the need to be able to abstract out that object
> relationship because Scarab might be pointing to another table instead of
> the SCARAB_MODULE table. This is a similar pattern as to what we have done
> with the User/Role/Permission/Group stuff.
>
> So, what I have done is created an interface called "ModuleEntity.java"...
> this interface describes what Scarab expects as a Module. There is then a
> default implementation of that class called ScarabModuleEntity. This class
> simply extends Module. I then have a Turbine Service that is responsible
> for instantiating an implementation of ModuleEntity based on a properties
> file entry. By doing this, it allows me to override what a "Module.java"
> is. By making "Module.java" abstract, that enforces the need for someone to
> extend Module.java and provide a specific implementation which is
> instantiated some other way (ie: through a Service).
>
> The problem however is that within BaseModule.java, there is a copy()
> method. This method has the following code:
>
> Module module = new Module();
>
> As you can see, with Module being abstract and the need to use the Service
> to get a reference to a ModuleEntity, having the code above in BaseModule
> is not good. Also, the fact that we are working with ModuleEntities now
> instead of just Module makes things even more complicated.
>
> So, what I would like to see is that copy() method be moved by generated
> default from the "BaseModule" class into the "Module" class. This way, I
> can edit the method to override the default functionality of the copy()
> method.
>
> It is a somewhat confusing thing to explain, so I hope that makes sense...
>
> thanks,
>
> -jon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]