Category Archive: Code Design

Dec 14 2013

Visual BOOST: True Object Oriented Programming for VBScript

After years of research, we are proud to announce a breakthrough that overcomes the limitations VBScript imposes on automation developers. Though the language supports the use of classes, it has always been in a very limited fashion. Now, with Visual BOOST by Meir Bar-Tal, the so essential inheritance and polymorphism features have been finally added to the …

Continue reading »

Aug 16 2013

Implementing Post/Pre Increment and Post/Pre Decrement

In a previous post (please read it first if you haven’t yet) we have seen how to implement C/C++ like arithmetic operators such as ++ and –, as well as += and -=. These languages also support postincrement and preincrement as well as postdecrement and predecrement), so the ++ and — operators work differently when preceding or …

Continue reading »

Aug 07 2013

C++ Style Integer Manipulations in VBScript

If you wondered whether it is possible to replace the awkward statements inside Do…While/Until loops (or to meet other requirements) such as: i = i + 1 a = arr(i) With the more convenient: a = arr(i++) As in languages such as C/C++ – then the answer is YES!   The following class CNum implements the design to achieve a pretty …

Continue reading »

May 29 2010

Class Delegation

Inheritance is a common way of extending and reusing the functionality of a class. Delegation is a more general way to extend a classes behavior. Delegation extends a class by using other classes functions, subroutines and properties rather than inheriting them. Inheritance is inappropriate for many situations in which delegation works well.
For example, inheritance is useful for capturing a “is-a-kind-of” relationships because of their very static nature. However, “is-a-role-played-by” relationships are akward to model with inheritance. With delegation you get instances of classes that can play multiple roles.

Jan 11 2010

VBScript++

For the entire time I’ve been working with HP QuickTest Pro and VBScript, I have had a yearning for real object support. Specifically, inheritance and polymorphism. I am a big fan of reusing every piece of code I can, and these two attributes contribute more to my productivity than any other concept in software development.
In addition, at one point when we were performing a refactoring of our automation framework

Oct 15 2008

Class Inheritance in VBScript – Now at your Doorstep!

ChangeLog: 5/10 : I’ve uploaded a new file with the fixed parser. Added support for code blocks with sensitive names (Function PrivateFunciton, Sub SpecialGet etc.) 10/10 : I’ve uploaded a new file with constructor arguments support, and a new regular expression engine (preserves comments and should make things go faster). Notice that the new file …

Continue reading »

Apr 01 2008

Factory Pattern

This article refers to design patterns, pointers and objects (discussed in the background section of this article), and classes. Make sure you’re familiar with these issues before reading on. It would also be prudent to brush up on the Singleton Pattern. We continue our tour of Design Patterns with another basic pattern – the Factory …

Continue reading »

Apr 01 2008

Singleton Pattern

This article refers to design patterns, pointers and objects (discussed in the background section of this article), and classes. Make sure you’re familiar with these issues before reading on. We begin our exploration of the world of Design Patterns with one of the simplest patterns – the Singleton. The Gang of Four eloquently summarize the …

Continue reading »

Mar 29 2008

Class Composition

This article deals with classes and their instances in VBScript. Make sure you’re familiar with the subject by reading the introduction article to classes. In this article we’ll cover the basics for composing classes (i.e. using one class from within another), and some common and less common uses for this technique. I’m sure that once …

Continue reading »

Mar 29 2008

Introduction to Classes

This article will very briefly cover the subject of VBScript classes. My purpose is not to do a detailed sweep, but only a quick reminder in order to move forward to more advanced topics and techniques in articles to come. You can find detailed information and demos on this subject in the book Scripting Quicktest …

Continue reading »

Older posts «

Fetch more items