LogoLogo
WinForms to WebPowerBuilder to .NETPowerBuilder to Java
  • WebMAP Documentation | Mobilize.Net
  • WinForms
    • Introduction
    • Getting Started
    • Conversion Process
    • Post-Conversion
    • Extend or Modify the Converted Application
      • NoWebMap Forms Winforms
        • How to add a new Form
        • Adding the created form to the migrated App
        • Interacting with the application data
        • Call the custom API
        • Interaction between the no webmap added Form and the WebMap components
      • Adding a component
      • Adding a component dynamically
      • Add a new control model
      • Switching CSS theme
      • Adding new window
      • Conversion Configuration
        • WebMAP configuration file
        • Stub Filter
      • Adding Non-WebMap Angular Forms
      • Adding FrontEnd Handler to a ToolStripMenuItem
      • Changing ToolStripButton icons
      • Adding new items to existing toolbar
      • Adding FrontEnd element properties and JS listeners
      • Adding FrontEnd output handlers
      • Access FrontEnd components
      • Create custom components based on existing WebMap Component
      • Override FrontEnd methods
    • Assessment Mode
    • Errors and Troubleshooting
      • How to resolve broken reference problems with VBUC
    • Portability
    • Glossary
    • Release Notes
    • Internal Demos
    • Known Issues
    • WinForms DCP
  • WebForms
    • Introduction
    • Overview
    • Desktop Compatibility Platform (DCP)
      • Pages and Master Pages
      • GridView and DataList data synchronization
      • HTTP objects
    • Post-Conversion
    • Extend or Modify the Converted Application
      • Adding FrontEnd validator
      • Adding Page
      • Adding MasterPage
    • Designer classes on WebForms Conversion Tool
    • Errors and Troubleshooting
      • How fix Solution when have been added website from filesystem without project file
    • Release Notes
  • PowerBuilder to .Net
    • Introduction
    • Getting Started
      • Conversion Tool
    • Desktop Compatibility Platform (DCP)
      • Data Manager
    • Reports
      • Report Rendering in Modernized Code
      • ReportWatcher Service Configuration
      • Data Manager to RDL Conversion
      • Reporting Service Internals
      • Troubleshooting
  • PowerBuilder to Java
    • Introduction
    • Getting started
    • Post-Conversion
      • Setup PBJava Environment
      • Architecture
      • App Start
    • Glossary
    • Errors
    • Glossary
    • FAQ
      • How to create a new Control
      • How to create a new Screen
      • What is the Mobilize.WebMAP.CoreServices.All?
      • What is the DesignerAttribute?
      • What is the InterceptedAttribute?
      • What is the InterceptedAttribute?
      • What is the ObservableAttribute?
      • What is the Mobilize.Weaving.WebMAPExtensions.All?
  • General
    • FrontEnd
      • Documentation
        • Webforms Angular Components
          • Web Components
            • Base Components
              • BaseValidator Component
            • KendoUI Components
              • CompareValidator
              • CustomValidator
              • RegularExpressionValidator
              • RequiredFieldValidator
              • ValidationSummary
          • Directives
          • AJAX Web Components
            • AjaxCalendar
            • AjaxModalPopupExtender
          • Ajax Interaction Services
        • Client Core
          • WebMap's Client Core
        • Angular Client
          • Introduction
          • WebMap Service
          • WebMap Interceptor Service
        • Base Components
          • Introduction
          • Components
            • Container
            • Control
            • ControlContainer
            • FormsContainer
            • Loading
            • Stub
        • Winforms Angular Components
          • Web Components
            • Base Components
              • Control Component
              • Form Container
              • Grid Component
              • Style
            • KendoUI Components
              • AdoDataControl
              • Button
              • C1TrueDBGrid
              • CheckBox
              • CheckedListBox
              • ComboBox
              • ContextMenuStrip
              • DataGridView
              • DataGridViewFlex
              • DateTimePicker
              • FileDialog
              • GroupBox
              • Label
              • ListBox
              • ListView
              • MaskedTextBox
              • MessageBox
              • NumericUpDown
              • Panel
              • PictureBox
              • PrintDialog
              • ProgressBar
              • RadioButton
              • RichTextBox
              • StatusStrip
              • Stup
              • TabControl
              • TabPage
              • TextBox
              • Timer
              • ToolStrip
              • TreeView
              • WebBrowser
              • Window
            • JQuery Web Components
          • WebMap FrontEnd Architecture
          • Migrated Structure
          • Setup
            • Front-End setup and compilation
            • Components Manual
            • Browser Support
            • Unit Test Manual
            • Development Process
            • Setup AOT/JIT Compilation
          • Decorators
            • Server Event
          • Conventions
            • Application Structure and NgModules
            • Coding
            • Components
            • Data Service
            • Directives
            • Lifecycle hooks
            • Names
            • Services
        • PowerBuilder Kendo Components
          • Base Components
            • base-component
            • column-control
            • controlcontainer
          • Data Manager Componets
            • base-data-manager
            • data-manager-control
            • data-manager-control-base
            • dw-checkbox
            • dw-column
            • dw-complexNumericMaskComponent
            • dw-compute
            • dw-date-time-edit-mask
            • dw-dropdowndatawindow
            • dw-edit
            • dw-edit-mask
            • dw-radio-button
            • dw-simple-numeric-edit-mask
            • dw-string-edit-mask
            • dw-time-edit-mask
          • Window Components
            • basemask
            • graphics
            • w-checkbox
            • w-command-button
            • w-complex-numeric-mask
            • w-date-time-edit-mask
            • w-dropdownlistbox
            • w-group-box
            • w-line
            • w-listbox
            • w-maskedtextbox
            • w-mdiclient
            • w-menu
            • w-multiline
            • w-picture
            • w-picture
            • w-radiobutton
            • w-rectangle
            • w-simple-numeric-edit-mask
            • w-single-line-edit
            • w-statictext
            • w-string-edit-mask
            • w-time-edit-mask
            • w-toolbar
            • w-toolbaritem
            • w-user-object
            • w-window
          • Services
            • DmInteractionService
          • DataManagerEvents
          • FocusManager guide
      • Api Documentation
        • WebMap Silverlight
        • WfNetC1Components
        • WebFormsComponents
      • Guides
        • Setup NPM package registry in the workspace
        • How to Setup WebMap Applications To Run Over SubDomains or WebApplications In IIS
        • Deploy several WebMap Apps in the same Server
        • Update to Angular 16
        • Appearance
          • How to change the CSS
          • How to override the style for a component
        • Component maintenance
          • How link WebMap package to the migrated Application
          • How to resolve broken reference problems with VBUC
          • How to test a local WebMap Components package
          • How to add a new component in a migrated application
          • How to update a component
          • Dynamic Control Support
          • How to add new set of component with a different provider
          • How to test your component in the playground
          • Tools
        • WMLogger
          • How to use the WMLogger's instance
          • How to change log's level
          • How to add log tags
        • Integration test
        • Setup WebMap Applications to Run Front-End And Back-End In Separates Sites
          • Setup WebMap Applications To Run Front-End And Back-End In Separates Sites in Production (IIS)
        • Setup Migrated WebMap Applications To Run Front-end & Back-end In Separates Sites (Only development)
        • Initial Set Up
          • Software to Install
          • Necessary Repositories
      • Errors
      • Version Notes
        • Client Core
        • Angular Client
        • Web Base Components
        • Winforms Angular Components
        • PowerBuilder Kendo Components
      • Licenses
        • Client Core
        • Angular Client
        • Base Components
        • PB Kendo Components
        • WFNet Kendo Components
        • WebForms Components
        • WFNet Access Components
        • WFNet Janus Components
        • WFNet C1 Components
        • Silverlight wms-framework
        • Silverlight i-components
    • BackEnd
      • WebMAP From Scratch
      • Setup
      • DCP: Desktop Compatibly Platform
        • Overview
        • Library Bundles
          • Bundle Library
            • Create an Observable Object
          • Bundle DTO
            • DTO: Data Transfer Objects
              • Creating a DTO
            • Mappers
              • Create Mappers
            • Observable Wrappers
              • Create an Observable Wrapper
            • API/Controllers
      • Architecture
      • Weaving on WebMAP
      • Glossary
      • FAQ
        • How to create a new Control
        • How to create a new Screen
        • What is the Mobilize.WebMAP.CoreServices.All?
        • What is the DesignerAttribute?
        • What is the InterceptedAttribute?
        • What is the Mobilize.Extensions.Logging.RollingFile?
        • What is the ObservableAttribute?
        • What is the Mobilize.Weaving.WebMAPExtensions.All?
      • Licenses
        • PBNet DCP
        • WebFormsDCP
        • WFNet DCP
        • CoreServices
        • CoreServicesCommon
    • Request and Response
  • SCALABILITY
    • Introduction
    • Microservices
    • Containerizing a WebMap .Net Application with Docker
    • Vertical scalability
Powered by GitBook
On this page
  • Bundles
  • Bundle Basic
  • BundleBasic.DTO

Was this helpful?

  1. PowerBuilder to .Net

Desktop Compatibility Platform (DCP)

This section talks about the Desktop Compatibility Platform commonly called DCP. It is a set of bundle packages composed of two main libraries Mobilize.Web.PB.BundleBasic and Mobilize.Web.PB.BundleBasic.DTO which are used to handle:

  • GUI life-cycles

  • Back-end controls: a class that holds state and operations to provide compatibility with the PowerBuilder objects, these objects are also known as Models.

  • Data Transfer Objects (DTO): is a plain old c# object. This class does not have any methods and it used only to send information back and forth with the front-end layer.

  • Mappers for the DTO: is a class that takes a control model and maps it to a data transfer object and vice versa.

  • Modal Dialog and Modal Messages.

  • Application State.

  • Command/Event execution.

  • Type Resolution: mechanism used by WebMAP to solve types between libraries.

  • Wrappers: a wrapper is a class used to hold the state of an object that cannot be migrated directly by the Conversion Tool or that are part of a third party library. For the PowerBuilder migration these classes are often used to handle the System.Collections library. E.g. The System.Collections.Generic.List will have to get a wrapper for this class in order to maintain this structure in the session.

  • Controllers: is a Web API Controller class that will enable the data query requests. Controls such as the DataManager, Treeview, ListBox, etc, need to use an APi to fetch their data from the back-end to the front-end in separate structure from their models.

The DCP is the most important component for the migrated code in the back-end application, it is the one that provides the functionality equivalent to the original source platform and its components. It also the component that determines what and how the back-end control will be sent to front-end and what deltas (DTO) coming from the front-end will be synchronized with the back-end control.

Bundles

Bundle Basic

The BundleBasic library is the one that provides the Control Models, GUI Life cycle mechanism, Application State mechanism, among others that are vital to emulate the original PowerBuilder behavior in the back-end of the migrated code.

Models

A model is a C# class used to represent the data of a PowerBuilder component, for each PowerBuilder control there is an equivalent model in WebMAP. E.g. Window Control in PB has a Window.cs model in WebMAP, a StaticText has its equivalent StaticText.cs model as well.

The state of each model needs to be tracked down by the WebMAP.CoreServices so it can adequately handle its reference count and ensure the object gets persisted in the application's current session. In order to do so the Observable and Intercepted attributes are used to mark model's classes and properties respectively.

  • Observable attribute: used to mark a model class as Observable; this means that this class contains properties that need to be tracked down by the WebMAP.CoreServices mechanism.

  • Intercepted attribute: is used to mark a property as observable, this means that the WebMAP.CoreServices will keep reference tracking of this object so it won't get removed by .NET framework during the garbage collection process. The interception mechanism is used by the Mapper mechanism as well, to ensure the property deltas are sent to the front-end only when they were modified, if a non intercepted property is used in a mapper it will send its value to the front-end in every single request made. The use of intercepted properties has the following restrictions.

    • The attribute to be needs applied individually to each auto-property in an observable class. Properties that are not auto-properties (the get or set have any kind of implementation in them) cannot be marked as intercepted.

    • In order to work correctly the Intercepted attribute has to be used in a class that is also has the Observable attribute, otherwise it won't work.

    • The type of the property needs to be a value type (int, long, string, bool, etc), another observable class or an object that has registered an Observable Wrapper or the WebMAP.CoreServices won't be able to keep track of it.

    [Mobilize.WebMap.Common.Attributes.Observable]
    public class Window : Control, IWindow
    {
        [Mobilize.WebMap.Common.Attributes.Intercepted]
        public bool? Visible { get; set; }
    }

Type Resolution

In a Powerbuilder is common to have circular references between libraries (which are resolved automatically), however, for the default .NET's project dependency this is not valid, and it cannot be used for the migrated solutions.

To solve this problem, type resolution was a mechanism created. PowerBuilder's instancing process is handled by the create method, which takes a type a parameter and returns and instance of the same type. WebMAP uses a similar concept except that instead of using the direct type; an interface is used. As shown in the image and code snippet below.

    var myApplication = Mobilize.Web.Application.Create();

In the migrated code for each class in the PowerBuilder code an interface is generated as well. Because the libraries cannot referenced between them they are then registered in the Application Site and the Create method is the one who decides how the instances are created.

In the Application Site AssemblyInfo class all of the libraries are registered in the same order as they were in the original application. This is important because if there is an interface with the same name in both Library1 and Library4, the one in Library1 is the one that gets instantiated because is the first one in the registration catalog.

    // ApplicationSite AssemblyInfo.cs
    [assembly: AssemblyLoadOrder(typeof(MyApplication.AssemblyIdentifier))]
    [assembly: AssemblyLoadOrder(typeof(Library1.AssemblyIdentifier))]
    [assembly: AssemblyLoadOrder(typeof(Library3.AssemblyIdentifier))]
    [assembly: AssemblyLoadOrder(typeof(Library4.AssemblyIdentifier))]
    [assembly: AssemblyLoadOrder(typeof(Library2.AssemblyIdentifier))]

BundleBasic.DTO

This project holds all of the necessary mechanisms used to communicate between the back-end the front-end applications.

Data Transfer Objects (DTO)

A Data Transfer Object is a plain C# object. This class does not have any kind methods and it is used only to send information back and forth between the back-end the front-end. A DTO serves as a contract between the server and the client layers, if a model property needs to be sent to the front-end it has to necessarily be included in the DTO specification.

    public class SingleLineEdit : IDataTransfer
    {
        public string Text { get; set; }
        public string Id { get; set; }
        public string MapperId { get; set; }
    [DataTransfer("dwColumn")]
    public class DmColumn
    {
        public Alignment? Alignment { get; set; }
    }

A DTO either has to be marked with the DataTransfer or has to implement the IDataTransfer which one depends mostly on the Mapper registration system.

Mappers

A Mapper is a class that takes a control and maps it to a data transfer object and vice versa. In other words, it glues up the Models and the DTO. When we want to send something to client or we want to synchronize deltas sent by client with back-end controls, we'll both require the mapper.

In order to create mapper it needs to implement the IMapper interface, been TModel and TDTO its respective Model and DTO types associated.

    public class SingleLineEditMapper : IMapper
    {
    }

It also need to be registered directly as a Mapper or as a part of a Mapper factory. A mapper can only be registered for a specific Type which means that if there is a class that inherits from a control that already has a mapper registered it won't work for the child class, to accomplish this a MapperFactory needs to be used.

    catalog.AddMapper(new DmColumn());

A MapperFactory is basically an object that allows a single mapper to be used by several types at the same time, this is commonly implemented for inherited classes.

    catalog.AddMapperFactory(new SingleLineEditFactory());
    public class SingleLineEditFactory : IMapperFactory
    {
        public bool CanGetMapper(Type type)
        {
            return typeof(Web.SingleLineEdit).IsAssignableFrom(type);
        }

        public MapperInformation GetMapperInformation(Type type)
        {
            return new MapperInformation(
                id: NamingConventions.ToClientName(type.FullName),
                mapper: new SingleLineEditMapper(type),
                inType: type,
                outType: typeof(DTO.SingleLineEdit));
        }
    }

Wrappers

An observable wrapper is a class that wraps another class that cannot be tracked via WebMAP's observable mechanism, they are commonly implemented for objects such as .NET native classes and data structures.

API/Controllers

Used to send data between back-end and front-end. Commonly used to send bulk data that is too big to be sent via DTO.

Controllers are responsible for responding to requests made from the front-end. In WebMAP, the items or nodes of a DataManager, DropDownListBox, ListBox and Treeview are not sent within the standard WebMAP request, so these kind of items and nodes are sent by means of a Controller Action.

    [Route("api/treeview/FetchItems")]
    [ApiController]
    public class TreeViewController
    {
        [HttpGet("{id}")]
        public Dictionary GetTreeViewItem(WebTreeView tv)
        {
            //...
        }
    }
PreviousConversion ToolNextData Manager

Was this helpful?