[jira] [Comment Edited] (OFBIZ-10579) Date filtered queries with caching should be restricted to cache

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (OFBIZ-10579) Date filtered queries with caching should be restricted to cache

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-10579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636599#comment-16636599 ]

Mathieu Lirzin edited comment on OFBIZ-10579 at 10/3/18 8:29 AM:
-----------------------------------------------------------------

Hello,

Here is a remark that is not concerning the performance optimization which seems to be a great idea, but the implementation of the visitor pattern used by the {{EntityConditionVisitor}} interface which makes *no sense*.  Here is the interface:

{code:java}
public interface EntityConditionVisitor {
    <T> void visit(T obj);
    <T> void accept(T obj);
    void acceptObject(Object obj);
    void acceptEntityCondition(EntityCondition condition);
    <T extends EntityCondition> void acceptEntityJoinOperator(EntityJoinOperator op, List<T> conditions);
    <L,R,T> void acceptEntityOperator(EntityOperator<L, R, T> op, L lhs, R rhs);
    <L,R> void acceptEntityComparisonOperator(EntityComparisonOperator<L, R> op, L lhs, R rhs);
    void acceptEntityConditionValue(EntityConditionValue value);
    void acceptEntityFieldValue(EntityFieldValue value);

    void acceptEntityExpr(EntityExpr expr);
    <T extends EntityCondition> void acceptEntityConditionList(EntityConditionList<T> list);
    void acceptEntityFieldMap(EntityFieldMap fieldMap);
    void acceptEntityConditionFunction(EntityConditionFunction func, EntityCondition nested);
    <T extends Comparable<?>> void acceptEntityFunction(EntityFunction<T> func);
    void acceptEntityWhereString(EntityWhereString condition);

    void acceptEntityDateFilterCondition(EntityDateFilterCondition condition);
}
{code}

This interface should *not* contain any {{accept}} methods but only {{visit}} methods, because {{accept}} is meant only for the visited classes not the visitor itself. Since {{EntityDateFilterDetector}} is the only and first implementation (at least in the framework) of the {{EntityConditionVisitor}} interface, I think we should fix this issue in the first place. I am willing to provide a patch for this.



was (Author: mthl):
Hello,

Here is a remark that is not concerning the performance optimization which seems to be a great idea, but the implementation of the visitor pattern used by the {{EntityConditionVisitor}} interface which makes *no sense*.  Here is the interface:

{code:java}
public interface EntityConditionVisitor {
    <T> void visit(T obj);
    <T> void accept(T obj);
    void acceptObject(Object obj);
    void acceptEntityCondition(EntityCondition condition);
    <T extends EntityCondition> void acceptEntityJoinOperator(EntityJoinOperator op, List<T> conditions);
    <L,R,T> void acceptEntityOperator(EntityOperator<L, R, T> op, L lhs, R rhs);
    <L,R> void acceptEntityComparisonOperator(EntityComparisonOperator<L, R> op, L lhs, R rhs);
    void acceptEntityConditionValue(EntityConditionValue value);
    void acceptEntityFieldValue(EntityFieldValue value);

    void acceptEntityExpr(EntityExpr expr);
    <T extends EntityCondition> void acceptEntityConditionList(EntityConditionList<T> list);
    void acceptEntityFieldMap(EntityFieldMap fieldMap);
    void acceptEntityConditionFunction(EntityConditionFunction func, EntityCondition nested);
    <T extends Comparable<?>> void acceptEntityFunction(EntityFunction<T> func);
    void acceptEntityWhereString(EntityWhereString condition);

    void acceptEntityDateFilterCondition(EntityDateFilterCondition condition);
}
{code}

This interface should *not* contain any {{accept}} methods but only {{visit}} methods, because {{accept}} is meant only for the visited classes not the visitor itself. Since {{EntityDateFilterDetector}} is the only and first implementation (at least in the framework) of the {{EntityConditionVisitor }} interface, I think we should fix this issue in the first place. I am willing to provide a patch for this.


> Date filtered queries with caching should be restricted to cache
> ----------------------------------------------------------------
>
>                 Key: OFBIZ-10579
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-10579
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: ALL APPLICATIONS
>    Affects Versions: Upcoming Branch
>            Reporter: Suraj Khurana
>            Assignee: Suraj Khurana
>            Priority: Major
>         Attachments: OFBIZ-10579.patch
>
>
> As per discussion on Dev ML 
> https://markmail.org/thread/3qnkihmsyhly3lsg



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)