[
https://jira.jboss.org/browse/SEAMINTL-7?page=com.atlassian.jira.plugin.s...
]
Lincoln Baxter III edited comment on SEAMINTL-7 at 11/10/10 12:28 PM:
----------------------------------------------------------------------
I think what you've got there is actually really good. I just worry that folks are
going to think it's too verbose, so I think we need a very simple default, too. Or
rather, a very simple approach to compliment it. One that doesn't require implementing
an interface, annotating it, injecting the interface with a special wrapper + annotation,
then calling get() in order to get the implemented interface proxy to display the
message.
That's a lot of work. nice when it's done, yes, but I think we can provide an
incremental approach to sort of let people get there if they want to. So, you can start
out simple, then very easily "upgrade" to the strongly typed messages, etc.
For example:
I think the StatusReporter<?> interface should serve much like an Instance<?>
wrapper, and should provide both the basic status message builder APIs, and also the
strongly typed message APIs if the generic type is provided:
public class Example {
@Inject StatusReporter basic; //
[1] most basic builder, no strong typing requested
@Inject StatusReporter<RegistrationStatusReporter> status; // [2] introducing
strong types
@Inject RegistrationStatusReporter registration; // [3] pure
strongly-typed access
public void method()
{
// [1]
basic.info().targets("foo").message("This is a message built using a
non-typed StatusReporter")
status.info().message("This is a custom message that is not strongly typed, still
available.");
// [2]
status.getTyped().userRegistered(user);
// [3]
registration.userRegistered(user);
}
}
was (Author: lincolnthree):
I think what you've got there is actually really good. I just worry that folks are
going to think it's too verbose, so I think we need a very simple default, too. Or
rather, a very simple approach to compliment it. One that doesn't require implementing
an interface, annotating it, injecting the interface with a special wrapper + annotation,
then calling get() in order to get the implemented interface proxy to display the
message.
That's a lot of work. nice when it's done, yes, but I think we can provide an
incremental approach to sort of let people get there if they want to. So, you can start
out simple, then very easily "upgrade" to the strongly typed messages, etc.
For example:
I think the StatusReporter<?> interface should serve much like an Instance<?>
wrapper, and should provide both the basic status message builder APIs, and also the
strongly typed message APIs if the generic type is provided:
public class Example {
@Inject StatusReporter basic; // most basic builder, no strong typing requested
@Inject StatusReporter<RegistrationStatusReporter> status; //introducing strong
types
@Inject RegistrationStatusReporter registration; // pure strongly-typed access
public void method()
{
basic.info().targets("foo").message("This is a message built using a
non-typed StatusReporter")
status.info().message("This is a custom message that is not strongly typed, still
available.");
status.getTyped().userRegistered(user);
registration.userRegistered(user);
}
}
Rewrite Messages API along the lines of JBoss Logging 3
-------------------------------------------------------
Key: SEAMINTL-7
URL:
https://jira.jboss.org/browse/SEAMINTL-7
Project: Seam i18n
Issue Type: Feature Request
Components: Messages
Affects Versions: 3.0.0.Alpha1
Reporter: Ken Finnigan
Assignee: Pete Muir
Fix For: 3.0.0.Beta1
Rewrite messages API along the lines of JBoss Logging 3 to be consistent with the logging
approach once the switch from slf4j is made to JBoss Logging 3.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira