deltaspike-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Louis MONTEIRO <jeano...@gmail.com>
Subject Re: proposal for JSF Messages
Date Fri, 05 Oct 2012 17:57:49 GMT
Hi Mark,

That's more or less the same spirit of the typed logger which is in my
opinion really useful.
For example, I like how it has been defined in Seam Solder.

Using the same idea for messages is also relevant in my opinion even if I
don't like your example with the logger ;-) Indeed, IMHO the logger level
should be defined in the typed logger itself to make it consistent all over
the application (i.e.. you should not be able to define a different level
each time you wanna use a message).

Then, getting the message only without producing a log is useful and can be
an option to the typed logger.

Jean-Louis



2012/10/5 Mark Struberg <struberg@yahoo.de>

> Hi folks!
>
> I thought quite some time about how we could do the typesafe messging for
> JSF. Today I had the following idea.
>
>
> Imagine a typesafe message
>
> @MessageBundle
> public interface SimpleMessage
> {
>     @MessageTemplate("Welcome to %s")
>     Message welcomeTo(String name);
> }
>
> This is nice but it's hard to use it for creating FacesMessages that way.
>
> Now imagine the following
>
> @Inject
> JsfMessage<SimpleMessge> message;
>
> ...
>
> message.addInfo().welcomeTo("DeltaSpike);
>
>
>
> public interface JsfMessage<T> {
>   T addInfo();
>   T addWarning();
>   T addError();
>   void clear();
> }
>
>
> I think it is possible to implement this, right?
>
> Wdyt from a users perspective?
>
> LieGrue,
> strub
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message