Well, this is what i meant:
The first approach:  creating an AbstractMessageMacro to do all the 
generic stuff and then inherit from it 3 classes, corresponding to the 
three macros (info, error and warning)
The second approach (the one i prefer): create a single implementation 
for all the three macros (with three different aliases and three entries 
in components.xml), as Thomas said.

Vincent Massol wrote:
> Hi Dan,
>
> On Jan 22, 2009, at 12:49 PM, Dan Miron wrote:
>
>   
>> Hi folks,
>>
>> Regarding the XWIKI-2968 <http://jira.xwiki.org/jira/browse/ 
>> XWIKI-2968>
>> issue, this is what i've been suggested:
>>
>> You should put warning, error and info macro in the same project  
>> based on the same AbstractMessageMacro or something like that  
>> because theses 3 macro have almost exactly the same code. You could  
>> even have only one java macro implementation and use the macro name  
>> to find the class name.
>>
>> Personally, I'm +1 for the second approach,
>>     
>
> What are the 1st and 2nd approaches? I see only one.
>
>   
>> creating a single java class for all the three macros, and  
>> dynamically check for the macro name and deciding what exactly macro  
>> type is to be rendered at runtime. Reason: It's simple, it's light,  
>> it's an easy to track approach.
>>     
>
> One class is fine but you still need to have macro aliases so that  
> people can use {{info}}, {{error}} and {{warning}} instead of the  
> generic {{message type="info|error|warning"}} macro.
>
>   
>> If you have a different opinion, please let me know.
>>
>> Tnx, Dan
>>     
>
> Thanks
> -Vincent
> http://xwiki.com
> http://xwiki.org
> http://massol.net
>
>
>
>
>
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
>   

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to