dWebSpec Dictionary
CONTEXT: descriptors->behavior-logic




All Details Standard Only Platform Only
Structured Web info and helpTechnologies
 Home Page
 Product Page
 Download Page
 Feedback
Javascript Tree Menu

Results for:

 behavior-logic 
Prev  Topic  Next

Whereas the define type behavior captures all objects that the page has access to, the logic type behavior captures the logical expressions used on the page. Such usage involves the visibility or enable statuses of segments or elements. These logical expressions could be explicitly stated in the attributes of the descriptors without separate behavior definitions. There are some useful purposes for these definitions. One primary reason is that, in the early part of the specification, it could be known that a segment would be displayed when the user has outstanding debt, without knowing, at that point, what expression would determine this. An entry in the logic type behavior descriptor would capture this with descriptive ID like user_has_debt; this would then be expanded on subsequently with the rest of the entries. The definition in one place with expressive identifier that could be used in many places also has its advantage.

The other reason is that logical expressions could be cryptic and platform dependent. For example, a check for empty string could look like this {theString == null || theString.lenth()= 0}. dWebSpec defines a minimum set of logical operations, in plain English. At implementation, or pre-implementation time, these could be converted to platform specific terms.

 ASP.NET  
The behavior logic descriptor example is shown below.

BEHAVIOR DESCRIPTORS

id

type

data-source

value

define-id

define-class

define-scope

details

debtorFlag less-than {customerBean.balance} 0        

The definition resides in this descriptor, but it would be referenced in other descriptors like element and segment. This logic could then be applied for the presentation attributes, like visible (render) or enable.

A list of standard logic types is provided below, and their equivalents on the ASP.NET platform. Explanations are provided where necessary.

dWebSpec Logical Behavior Type

Description

ASP.NET equivalent

equal

 

#{ property ==  value}

not-equal

 

#{String.Compare(property,  value) != 0}

greater-equal

 

#{String.Compare(property,  value) >= 0}

greater-than

 

#{String.Compare(property,  value) > 0}

less-equal

 

#{String.Compare(property,  value) <= 0}

less-than

 

#{String.Compare(property,  value) < 0}

empty

Null object or empty string

#{ String.IsNullOrEmpty(property)}

not-empty

Not null object and not empty string

#{ !String.IsNullOrEmpty(property)}

present

Present within a list. For instance role present; whether a user role is present within a list of roles. This could also be used to verify presence of cookies and header entries.

#{ User.IsInRole("admin")}

not-present

Not present within a list. For instance role not present; whether a user role is not present within a list of roles.

Converse of entry above.

expression

The standard logic types are defined to provide for easy to read specification documentations. The expression using target platform syntax could also be needed to enhance precision in the specification.

"#{ logical-expression }"

The applications of these behaviors are to the segment and elements; discussions on their implementations are discussed in the related descriptors.

Prev Next