Expression Engine


What it will do -

This system is defined to evaluate various kind of expressions.

With the basic version, it is capable of evaluating the mathematical, logical and object property expressions. However system can be extended easily to evaluate any new type of expression like XML. The extensibility comes from the definition of grammar, parsing rules and expression implementations in the configuration files (XML based), which can be extended easily.

System does have support for evaluating the functions and variables. User just need to provide the helping classes having implementation for functions and variables. Any new implementation can be plugged easily to the system.

 

System is also capable to return the possible return type for any expression without actually evaluating the expression. Another capability is to get the possible operand types for any expression. This is very usable features while implementing the UI for any tool which is based on expression evaluation for its features.

System is capable to work in multi-threaded environment.

What purpose it will solve -

The expression engine can be used as a plug-gable component with other framework components like
-With BPEL based Workflow Engine which require an expression evaluator,
-Or with a UI framework to evaluate the properties of various data objects and fill these in UI components,
-Or by any scientific or mathematics research program,
-Or with any financial or general software which need to evaluate the expressions.

What problem will it solve -

As define with the purpose, many of the software may need this component. It helps the developer to avoid reinventing the wheel and help them to easily plug the expression evaluation with their software. Besides it, it will be very simple in use and will not be dependent on other libraries (It may require one or two utility classes from our utility library).

Examples:

Airthmatic Expressions -

2+5-7*8
20-(5*3)+10

Logical Expressions -

a && b
(2-1) > 0

Expressions with variables -

principle * rate * 100 / time, where principle, rate and time are the variables

Expressions with Functions -

CurrentBalance + SimpleInterest (principle, rate, time)

Object property expression -

person.city.name, where person is the identifier which points to java object of Person class and city is the property of person and further name is the property of city

Future Goals:
XML Expression Support
A Sample UI with support of expressions

People who read this post also read :



0 comments:

Post a Comment