-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combine @URLPattern and @ForwardTo into a single new annotation @Join #60
Comments
Hey there, I just started working on this. But unfortunately it seems to be harder than I initially thought. I'm commenting on this ticket to keep you up to date and to sort my own thought regarding this. :) Much of the existing handler codes assumes that we are building the rule using a RuleBuilder which isn't the case any more. I'm not completely sure how to handle that in a consistent way. A very central part of the problem seems to be the ClassContext currently provides the handlers a RuleBuilder that is created by the annotation scanning API, handed over to the handlers and then added to the configuration if the handlers added any conditions or operations to it. That is essential the currently way the annotation handler API works. This concept won't work any more because Joins are custom rule implementations that work completely different. At first I thought about letting ClassContext expose both a ConditionBuilder and a OperationBuilder for the handlers to work with, but I think that also won't work correctly for Joins. I think what is currently missing is a simple API to add conditions and operations to rules (Joins or RuleBuilders). Thoughts? Christian |
Good question. What do you think this API would look like? I don't particularly like the idea of the |
I agree. The Rule interface shouldn't be changed. It should be immutable. Join and RuleBuilder are currently very focused on a fluent style of configuration. That makes it hard to use the API in the handlers. See for example this code to add a condition to a rule: It works, but it's not nice. And essentially this code creates a new composite condition and sets this as the "main" condition of the rule. But Join doesn't provide something like when() to overwrite the existing condition. And I don't think it should. What about adding an interface like this:
Both Join and RuleBuilder could implement this. At first I thought that ConditionBuilder could be used for this, but it works differently and use for useful for the fluent API. Just my thought on this. Haven't thought about all the details yet. :) |
…ss (preparation for ocpsoft#60)
Done! See this commit in the PrettyFaces repository. The syntax looks nice and simple: |
I like it! I have an idea. Do you think we can remove the need for the target path if the user has Just a thought :) Thinking of ways we could eliminate the need for EL and ~Lincoln On Sat, Jul 28, 2012 at 1:40 AM, Christian Kaltepoth <
Lincoln Baxter, III |
Btw. You know the only reason more ideas happen is because of good ideas :) On Sat, Jul 28, 2012 at 11:03 PM, Lincoln Baxter, III <
Lincoln Baxter, III |
So, you mean to remove the Something like this: @URLPattern("/user/{id}")
public class MyBean {
@Action
public String action( @ActionParam int id ) {
// Do something
return "....";
}
} I think this should be very easy. |
No description provided.
The text was updated successfully, but these errors were encountered: