DESCRIPTION

A UR::BoolExpr object captures a set of match criteria for some class of object.

Calls to get(), create(), and define_set() all use this internally to objectify their paramters. If given a boolean expression object directly they will use it. Otherwise they will construct one from the parameters given.

They have a 1:1 correspondence within the WHERE clause in an SQL statement where RDBMS persistance is used. They also imply the FROM clause in these cases, since the query properties control which joins must be included to return the matching object set.

REFLECTION

SUBCLASSES

The ::Rule class is abstract, but the primary constructor (resolve_normalized_rule_for_class_and_params),
automatically returns rules of the correct subclass for the specified parameters.
Currently it always returns a ::Rule::And object, which is the composite of all key-value pairs passed-in.

::Rule::And

Rules of this type contain a list of other rules, ALL of which must be true for the given rule to be true.
Inherits from the intermediate class ::Rule::Composite.

::Rule::Or

Rules of this type contain a list of other rules, ANY of which must be true for the given rule to be true.
Inherits from the intermediate class ::Rule::Composite.

::Rule::PropertyComparison

Rules of this type compare a single property on the subject, using a specific comparison operator,
against a specific value (or value set for certain operators). This is the low-level non-composite rule.

INTERNAL STRUCTURE

A rule has an "id", which completely describes the rule in stringified form, and a method called evaluate($o) which tests the rule on a given object.

The id is composed of two parts: - A template_id. - A value_id.

Nearly all real work delegates to the template to avoid duplication of cached details.

The template_id embeds several other properties, for which the rule delegates to it: - subject_class_name, objects of which the rule can be applied-to - subclass_name, the subclass of rule (property comparison, and, or "or") - the body of the rule either key-op-val, or a list of other rules

For example, the rule GSC::Clone name=x,chromosome>y: - the template_id embeds: subject_class_name = GSC::Clone subclass_name = UR::BoolExpr::And and the key-op pairs in sorted order: "chromosome>,name=" - the value_id embeds the x,y values in a special format

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.