Migrating Applications to Visual DataFlex 12.0

A Data Access Worldwide White Paper
by Marcia Booth

February 8, 2007
Last edited: February 8, 2007

Visual DataFlex 12.0 brings a lot of useful features to your development environment; features that will make you much more productive in developing your applications and will make you addicted to using the new Studio.

All that is good, but before you migrate your applications, it would be a good idea to familiarize yourself with the changes Visual DataFlex 12.0 brings to your development environment, especially in regards to:

After reviewing those items, you will have a better understanding of the new development environment that Visual DataFlex 12.0 introduces. You should be, then, ready to take the next step and migrate your applications.

New Concepts

1.      Projects

Projects used to be referred to as applications.

A project is the code that you compile and run.  A project consists of a file (usually a .src file) that uses other components (component files, class files, Data Dictionary files, etc.) to create an executable program. A project can be large (e.g. MyBigApplication.src) containing all of the components and classes within your workspace, or it can be small (e.g. MyTest.src) consisting of a few components that you wish to test.

You can create as few or as many projects within a workspace as you wish. For a project to be part of a workspace, you must add the project file to a list that the Studio maintains. Projects can be easily added or removed from this list.

The Studio expects you to always select a current project and then work within that project. When you tell the Studio to compile, debug or run, it will always operate on the current project. When the Studio provides you with code-sense, that information will come from the current project’s perspective.

2.      Autonomous Files

Any source file can be considered to be autonomous or non-autonomous.

An autonomous file is a file where all of its class dependencies (required super-classes and mixins) are satisfied by the file or by one of the files it uses. From a development point of view, an autonomous file is the most flexible type of file. You can drop this file into any project or use it within any other file and you are sure that all the files required to allow this file to compile have been brought along. From the Studio's point of view, an autonomous file allows it to most fully understand and, therefore, most fully model the classes and objects within the file. All of the objects, classes, super-classes, mixins and their interfaces are all known to the Studio.

A non-autonomous file is a file where not all of the class dependencies are satisfied by the file or the files it uses. A non-autonomous file cannot be compiled stand-alone. However, when used within a project, a non-autonomous file can be properly compiled. This occurs because the files and classes that the non-autonomous files are dependent upon are provided by the other files used within the project. The Studio cannot fully model a non-autonomous file when it is considered as a standalone file. Classes and interfaces may exist in other files and the Studio has no way of knowing where those classes are.

In order to help the Studio understand and model a non-autonomous file, we need to tell the Studio that those non-autonomous files are part of a larger project. This is done by context: if your non-autonomous file is a member of the current project (i.e., it will get used and compiled when the current project is compiled), the Studio will use all of the files available in the current project to help satisfy any missing dependencies.

3.      Libraries

A Library is a group of classes (files) that are defined in a way that they can be used by multiple workspaces. A workspace may include any number of libraries. By “include” we really mean, “point to”. When a library is added to a workspace, the library paths are added to the workspace’s makepath.

It should be your goal to organize your workspaces and libraries in a way that offers maximum ease of use, flexibility and portability. This is best accomplished by:

  1. Using relative paths

  2. Arranging your workspaces and libraries so that they have a common root. This makes it easier to support relative paths, to check in and check out entire source areas, and to copy development areas to other computers.

  3. Using sub-directories under AppSrc path to organize your files

  4. Avoiding the use multiple AppSrc paths – use Libraries (2) and sub-directories (3) instead.

  5. Not changing the system make path. If you want to add system-wide directories, use libraries

Libraries are themselves just a workspace. Libraries are created and maintained within that library’s workspace.  Although libraries are complete workspaces, only their classes are used within other workspaces.   

A library has its own AppSrc\config folder containing all of the required configuration information such as a class list, templates and object preference files. All those files will be available to the workspace using the library.

A library may contain other libraries. When a library defines classes, it will define those classes based on the super-classes that are already defined. Those super-classes can be classes defined in the library, classes defined in a library being used by the library, or classes defined in the System Class Library.

The System Class Library consists of the packages and classes installed as part of a Standard Visual DataFlex installation. The files in the System Class Library are read-only and should never be changed by the developer.

All workspaces and all libraries always have access to the System Class Library. They do not need to be explicitly added as a library.

 

Work Habits

1.   Project-Oriented Environment

Visual DataFlex Studio expects you to always work within a project. So any Visual DataFlex component you create must be added to a project before it can be compiled, run, tested and deployed.

When you are building an application, your actual project or projects may be quite large. If you need to test new or changed components, it could be a big overhead to compile and run your actual projects to refine those components. There will be times when you will have to do this, but for basic component testing, you can use a smaller project; a test project.

A test project is just a project that gets used for test purposes. If your project is small enough, your test project may be your actual project.

If your project is a web project, you are only allowed to create a single web project per workspace and that project must be named “WebApp.src”. Therefore, with a web project, your main project and your test project are one and the same.

If you use test projects, you may have a single test project or you may have many test projects, each one customized to handle a specific need.  Your test projects may be used to test a single component (e.g. a view) or they may be used to test multiple components (e.g. views and reports).

The components within a test project may end up being entirely maintained by Workspace Explorer or you may wish to directly modify the contents of your test project. You may end up creating a test project from a template and using it without any modifications, or you may need to perform significant alterations.

A typical testing process may proceed as follows:

  1. Create your Test Windows Project. You may only do this once you created your workspace.

  2. Create a new View with either a wizard or a template selecting your Test Project as the target project. Upon completion, your component will be added to that project.

  3. Make any custom changes you need to your component.

  4. Set breakpoints as needed.

  5. Compile and run the Test Project.

  6. Debug your project as needed.

  7. Fix any errors and go back to c.  It is expected that steps c – f will be repeated many times. When you finally have things “right” go to h.

  8. You might want to add this component to your main project.  If this is the case:

You may now wish to create and test another component. Repeat Steps b – g  as needed. If you follow these exact steps, your test project would now contain two components: the older tested one and the one you just created. You might find that having both components is useful for testing in which case you would leave things as is.

If you wish to remove the older component, click on Workspace Explorer and remove it.

Again it is worth noting that this describes the simplest method for testing projects and components. It is expected that developers will want to use this as a starting point.  Some of the more advanced development strategies might include:

 2.   Multi-Developer Environment

A multi-developer environment is an environment where several developers work on any single workspace, meaning that these developers open files in the same workspace concurrently. That is a common but very risky and error-prone practice.

There are many problems with sharing workspaces over a network:

For integrity reasons, the Studio will not normally allow you to share workspaces over a network. If you are currently doing this, we strongly encourage you to reevaluate this strategy. 

Our recommendations for multiple developers working on joint Visual DataFlex projects are as follows:

These recommendations are consistent with the expected development strategies utilized by most modern development systems and it is no different when working in the Visual DataFlex environment.

The Visual DataFlex Environment

When installing the Visual DataFlex Studio, numerous components are installed, created and registered on the operating system, including folders, files, ActiveX controls and dynamic link libraries (DLLs). If installing on a Windows operating system with Internet Information Server (IIS) running, the Web Application Server service is also installed and registered, and multiple virtual directories created and configured.

Due to the nature of the various components installed and their requirements, it is not possible for all of these pieces to be installed over a network. The Studio should be installed locally (on a local hard drive) and is only tested and supported in that manner.

During the typical development cycle, Visual DataFlex Studio performs the following actions:

All of the above processes are affected by hardware performance, such as hard disc access, processor speed and RAM. Consider whether the location of the workspaces you work on will affect your development productivity. Generally speaking, installing Visual DataFlex Studio and project workspaces on a local hard drive is optimal for maximum speed and efficiency.

Conclusion

Sharing workspaces over a network is a risky and error-prone practice that it is in no way recommended. No development tool supports or should support this way of working.

If you are currently doing this, we strongly encourage you to reevaluate this strategy following the recommendations we listed above.

While you restructure your development environment to comply with our recommendations, you may use an interim workaround: share the workspace folders but have a local IDESrc.

The one directory in a workspace that cannot be shared is the IdeSrc directory. If an environment is configured where each developer has their own IdeSrc directory for a workspace, the workspace can be shared. This could be accomplished through the use of a common local directory name (e.g. C:\LocalIdeSrc on each developer machine) or though the use of multiple .sws and .ws files, or through alternative drive mappings.

Although this allows multiple users to access the same shared workspace, it solves none of the problems previously listed. This strategy is not recommended and should be used only temporarily.

 

Workspace Management

1.      Workspace Structure

2.      Workspace Files

3.      Workspace Classes

4.      Global Classes

5.      Global Paths

 

New Options

Visual DataFlex Studio 12.0 introduces different concepts and has a totally new design. However, some features found in the previous revisions of the product are still present; they were just redesigned or relocated.

Here is a list of the most common features and how to get to them – this will help you getting started:

1.   Importing an ActiveX control

This is now found in File | New menu options, under Class tab: Import COM ActiveX

 

2.   Adding Web Service Client Classes

This is now found in File | New menu options, under Class tab: Client Web Service Class.

 

3.   Creating Subclass Layers

Now you can subclass any classes at any time. Just select File | New menu options, under Class tab: New Class or Multiple Classes.

You should consider using libraries to help you organizing your layers.

 

4.   Adding and Removing Classes from the Class Palette

No DFC files are used in the new Studio. In order to add or remove a class from the class palette you will need to right-click on the class palette and select Add class to palette or Remove class from palette.

When working with libraries, you should use Add/Remove libraries.

 

5.   Defining the Tab Order of your Objects

You can now right-click on the object name from the Code Explorer tree and select Move Object Up and Move Object Down.

 

6.   Working with Non-Visual Objects

Non-visual objects from your workspace’s class list can be dropped onto a Designer view. However, those objects will only be visible in your source code, not in the Visual Designer – the Visual Designer only displays what you will see when running your application.

In order to select those objects and view/edit the properties in the properties window, you will need to click on them from the Code Explorer tree.

 

7.   Using Compile-time Conditionals

The Studio Parser can be configured with respect to how it should treat #IFDEF source code blocks.

By default the Studio parses all code on both sides of the #IFDEF, and it can be configured to parse only the true block or the false block. In most cases the default configuration will be adequate. It means that the Studio will parse and collect information about both sides of the specified #IFDEF block, which gives the Studio more information about your workspace.

However, in some cases, parsing both sides of the #IFDEF block, can cause conflicting information which may lead to metadata errors. For example, both sides might define a class with the same name, which would confuse the Studio.

In that case you can configure the workspace to treat the specified symbol as evaluating to true/false, which will instruct the Studio to parse only one side of the #IFDEF block. In most cases, #IFDEF blocks cause no metadata conflicts, and the Studio can safely parse both sides, simply collecting as much information as possible.

To configure how the workspace should treat specific #IFDEF symbols, open the Configure Workspace Properties dialog, accessed from the Tools menu, and select the Conditionals tab. You can specify each #IFDEF symbol, e.g. USE$VPE, and whether the Studio should parse the true/false block.

The Studio also has a built-in #IFDEF rule, IS$WINDOWS, which evaluates to true and causes the Studio to parse the true block and ignore the false block.

 

Migrating your Applications

So, it is time to move on to 12.0, but how can you smoothly get your applications migrated to Visual DataFlex 12.0?

It’s fast & easy! You just need to use the Workspace Migration Wizard included in the product and all will be done for you.

The wizard will help you bring your applications from a previous revision of Visual DataFlex into Visual DataFlex 12.0. All settings from your current environment and specifically for your workspace should be converted to conform with the requirements of the new Visual DataFlex revision. This will allow the features you built in previous revisions to be used in the latest revision.

The workspace migration process involves examining the source code used in the workspace as well as the environment settings (like system make path, registry subclasses, subclass layers, registered components, class palette classes, etc.) and translating all that into something the new revision can understand.

The necessary changes to the source code and the workspace configuration can be automatically preformed through the wizard. The wizard can operate in two different modes: Full or Limited.

In full migration mode, the wizard has access to the host environment (i.e. the original Visual DataFlex Studio is installed on this machine and the selected workspace is registered in it) and it will be able to detect environment settings like global subclass layer, subclasses preferences, class palette classes, etc. If you run in full migration mode, all your settings and files used by the workspace will be migrated.

In limited migration mode, the wizard does not have access to the host environment and it will not be able to detect environment settings like global subclass layer, subclasses preferences, class palette classes, etc. If you run the wizard in limited migration mode, just the workspace and the source code specified in the paths in its WS file will be examined and migrated.

Before you start the Workspace Migration Wizard for migrating your workspace, take a moment to analyze its structure and content:

 

Depending on the current Visual DataFlex revision of your application, you will need to have different starting points:

Visual DataFlex 7 (or earlier) and WebApp 3 Applications

  1. If you do not have Visual DataFlex 11.1 Studio installed, download and install it. You can run VDF 11.1 for 30 days in evaluation mode, even if you do not plan to use it for development.

  2. Launch the "Migrate VDF 7 Workspaces" wizard from Start |  Programs | Visual DataFlex 11.1 | Utilities | Migrate VDF 7 Workspaces.

  3. Follow the instructions in the wizard to migrate the workspace to Visual DataFlex 11.1.

Once successfully migrated to VDF 11.1, follow the instructions to migrate the workspace to Visual DataFlex 12 listed under Visual DataFlex 8 (or higher) Applications.

 Visual DataFlex 8 (or higher) Applications

  1. Open the Visual DataFlex 12.0 Studio.

  2. Select "Open Workspace" from the File menu.

  3. Select "Workspaces to migrate (*.ws, *.sws)" from the "Files of type" combo box.

  4. Navigate to the .ws file of the workspace you would like to migrate.

  5. Follow the instructions in the wizard to migrate the workspace to Visual DataFlex 12.0.

Important!

The Workspace Migration Wizard does not create any virtual directories when migrating a workspace. So, after migrating any web application, you will need to use the Web Application Administrator to configure those applications for Visual DataFlex 12.0.

 

Additional Reading

http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2272

http://www.dataaccess.com/whitepapers/Getting_the_most_from_Visual_DataFlex_Studio.htm

news://news.dataaccess.com/project-horizon

 

Data Access Worldwide
14000 SW 119 Ave
Miami, FL 33186
305-238-0012
Domestic Sales: 800-451-3539
Fax: 305-238-0017
email: sales@dataaccess.com
Newsgroup Server: news.dataaccess.com
Internet: http://www.dataaccess.com

Data Access Worldwide - Asia Pacific
Suite 5, 333 Wantirna Road, Wantirna VIC 3152 Australia
Phone: +61 3 9800 4233 f: +61 3 9800 4255
Sales: asiapacific@DataAccess.com
Support: support.asiapacific@DataAccess.com
Internet: http://www.DataAccess.com/AsiaPacific

Data Access Worldwide - Brasil
Av.Paulista, 1776 - 21st.Floor
São Paulo -SP - Brazil
CEP 01310-921
Phone: 5511-3262-2000
Fax 5511-3284-1579
Sales: info@dataaccess.com.br
Support: suporte@dataaccess.com.br
Internet: http://www.dataaccess.com.br

Data Access Worldwide - Europe
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
Sales: info@dataaccess.nl
Support: support@dataaccess.nl
Internet: http://www.dataaccess.nl

Data Access Technical Support
800-451-3539 / 305-232-3142
email: support@dataaccess.com
Visit our Support Home page to see all of our Support options: http://www.dataaccess.com/support

Data Access Technical Knowledge Base    http://www.dataaccess.com/kbase
Many answers to technical problems can be found online in the Data Access Technical Knowledge Base. Here, you can access the same live data that Data Access Worldwide technical support and development staff use to enter and track technical articles. 

Copyright Notice
This document is property of Data Access Corporation. With credit to Data Access Corporation for its authorship, you are encouraged to reproduce this information in any format either on paper or electronically, in whole or in part. You may publish this paper as a stand alone document within your own publications conditional on the maintenance of the intent, context, and integrity of the material as it is presented here.

DataFlex is a registered trademark of Data Access Corporation.

NO LIABILITY FOR CONSEQUENTIAL DAMAGES
To the maximum extent permitted by applicable law, in no event shall Data Access Corporation be liable for any special, incidental, indirect, or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use any information provided in this document, even if Data Access Corporation has been advised of the possibility of such damages. Because some states and jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you.