A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

What is descriptive programming and ways to use descriptive programming?

The role of descriptive programming comes in to play whenever an operation is required to be performed on an object that does not reside in the object repository.

There are two ways to put descriptive programming in to use as mentioned below:
1. By creating a collection of object properties for the purpose of description and
2. By passing on the string arguments in the form of description.

Let us now focus on the second way of using descriptive programming i.e., by passing on the string arguments in the form of description.

How to use descriptive programming by passing string arguments in the form of description?

– Actually, this is the most common method that is employed for using the descriptive programming.
– In a statement, an object can be described directly by making a specification of the object property instead of making a specification of the name of the object.
– General syntax of the property specification is as follows:
TestObject ( “propertyname 1 : = property value 1 “, “ … “ , “propertyname N := propertyvalueX” )
– The above syntax involves giving the value of the property against the corresponding property name.
– Each of the pair of the property name and property value set must be enclosed in braces separated by quotation as well as commas.
– Based up on the property values that are to be retrieved during run time a variable name can be entered as a property value.
– Confusion may be caused regarding what values and properties are to be used but there is no need to worry since you have the object spy at your rescue.
– To use object spy for this purpose go to tools and click on the option “object spy”.
– In the dialog box that opens up select the “test object properties” radio button.
– Now, you can start spying up on the object as you desire.
– Also, you will get a properties list where you can find and write down the properties as well as their values that can be used for the object identification purpose.

Now we shall discuss about the first way of using descriptive programming and we are explaining this after the second one because this one is some what similar to the strings arguments method and so you can have an idea.

How to use descriptive programming by creating a collection of object properties for the purpose of description?

– The basic difference between the two ways is that here all the properties of a particular object are collected by creating an instance of that particular object.
– Later, the created instance helps in referring to the object itself and the burden of writing the string arguments over and over again is eliminated.
– Even though this method overcomes the problem of writing string arguments repeatedly, it is less preferred by people since it is difficult to be carried out and so the second method is more common.
– This method involves creation of an empty or a blank description.
– Whenever a property name is used for the first time, it is added to the properties collection and it is modified whenever it is used.
– Each property that is defined is treated as a regular expression by default.
– If you want a property not to be marked as a regular expression then you need to check the “regular expression” property as false.
– A description object can be used to obtain the objects on a particular page which matches with particular specific description.
– It can also be checked before using a property that whether it exists or not.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>