1.3.3.3 Using VIEW/VIEW32 Typed Buffers

The Tuxedo .NET Workstation Client uses class TypedVIEW to create and access VIEW/VIEW32 data. You should do the following steps to develop Tuxedo .NET Workstation Client applications using VIEW/VIEW32 typed buffers:

  1. Define the VIEW definition file (.v).
  2. Use the Tuxedo .NET Workstation Client viewcs utility to compile the VIEW definition file into a VIEW binary file (.VV). For more information, see viewc(1),viewcs(1).
  3. Use the Tuxedo .NET Workstation Client viewcs utility to generate class TypedVIEW derived definition C# code and corresponding .dll library (if necessary) from the View binary file.
  4. Use class TypedVIEW to write your .NET application.

    Using class TypedVIEW provides you with two options:

    • Option 1: No Environment Variables

      This is the most common usage of TypedVIEW.

      Use the viewcs utility to generate derived class TypedVIEW definition C# code from the xxx.VV file, then compile the C# code into an .exe file. No additional environment variables are required.

      See the following example:

      viewcs(32) view1.VV view2.VV
      buildnetclient -o simpapp.exe simpapp.cs view1.cs view2.cs
    • Option 2: Use .NET Assembly Environment Variables

      You can use the viewcs utility along with .NET assembly environment variables to generate .dll libraries. The .NET assembly environment variables ASSFILES, ASSDIR (ASSFILES32, ASSDIR32 for view32) must be set accordingly in order to view viewcs-generated .dll libraries.

      Note:

      TypedView must link to .dll libraries instead of C# code in the .NET environment. This is because it compiles the class type into .dll libraries or .exe files. If the definition is compiled into both .dll libraries and .exe files, the output binaries for these two files are not the same.

      Using these environment variables, .dll libraries can be generated automatically or manually:

      Automatic viewcs -generated .dll libraries

      This method may be used when many xxx.VV files exist. To simplify management of TypedVIEW C# code, these xxx.VV files can be compiled into a .dll library.

      Use the viewcs utility to generate derived class TypedVIEW definition C# code and corresponding .dll library from the xxx.VV files. Manually register the libwscdnet.dll assembly, and then compile your client application using the .dll library.

      See the following example:

      viewcs(32) view.dll view1.VV view2.VV
      gacutil.exe /i view.dll
      buildnetclient -o simpapp.exe simpapp.cs view.dll
      set ASSFILES(32)=view.dll
      set ASSDIR(32)=%APDIR%

      Manual-generated .dll Libraries

      In certain integrated programming environments (for example, VB .NET, and ASP.NET). the framework provides the executing environment. Client applications are integrated as .dll files. In this case it is best to manually generate .dll libraries.

      Use the viewcs utility to generate derived class TypedVIEW definition C# code from the xxx.VV file, then compile the C# code into an application .dll.

      The .NET assembly environment variables ASSFILES, ASSDIR (ASSFILES32, ASSDIR32 for view32) must be set to application .dll libraries and directories that have TypedVIEW defined.

      See the following example:

      viewcs(32) view1.VV view2.VV
      csc /t:library /out:simpapp.dll /r:%TUXDIR%\bin\libwscdnet.dll simpapp.cs
      view1.cs view2.cs
      set ASSFILES(32)=simpapp.dll
      set ASSDIR(32)=%APDIR%

The Typed Buffer Samples file (included in the Tuxedo . NET Workstation Client package) demonstrates how to use FML and VIEW typed buffers.