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 <[email protected]> > 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 > >
