Tips For Delphi Developers
From Morfikwiki.com
To a Delphi developer, at first Morfik AppsBuilder looks very similar to Delphi. It really is, but in order to be a Web development tool, AppsBuilder must support the the characteristics that make the web special but which, at the same time, makes it different from Win32.
Most differences in how to do something in Morfik from how you would do it in Delphi comes from the different underlying platforms: Web vs. Win32.
This is a list of tips which are meant to call the attention of a Delphi developer to where the two platforms, and therefore the two tools, differ in behavior.
For an introductory welcome see Morfik for Delphi Developers.
Contents |
[edit] Asynchronous Environment
The asynchronous nature of a Web application is the main initial challenge a Delphi developer faces when starting to work with Morfik.
It is essential that the developer recognizes that the nature of the Web is asynchronous and that it precludes the creation of browser side code which is exactly the same as one would have in a traditional Win32 application.
The Morfik Framework, which is available in Object Pascal, offers some features which help to minimize the effort for getting into this new world. In order to avoid the need to continually handle the mundane everyday aspects of asynchronously calling the server and receiving the reply (which might come in in chunks) the Morfik Framework implements a set of methods which do this for the developer, when opening forms, running reports or making calls to web services.
Whenever you are writing browser side code, this is one important aspect o keep in mind as it is common for people to forget it and write code as if it would execute synchronously.
[edit] Dual Modules
Dual modules are another feature of Morfik which will be new to the Delphi developer and which is, also, associated with the difference in nature of Web applications to traditional Win32 applications. Web applications, most of the time, have both a browser and a server side component to them.
In Object Pascal terms a module is a unit and a dual module actually contains two units with the same name, one for the browser and another for the server side of the application. Within the Morfik IDE the developer can switch from one to the other by clicking on tabs which are available right below the code editor.
Morfik AppsBuilder does allow the developer to create both browser-only and server-only applications easily but many developers will probably enjoy the ease and flexibility of the single WebOS project that contains both side of a Web application.
[edit] Web Services
Morfik WebOS AppsBuilder makes it easy to create Web Service APIs for usage in other Morfik applications or for calling from other platforms. Being an environment specifically designed for the creation of Web applications Morfik AppsBuilder creates Web Service enabled applications by default.
Web Service APIs are created in Morfik by creating descendants of the WebMethod class. The Morfik compiler automatically generates the .wsdl file required for other applications to call your services.
[edit] Data-bound Forms
In Morfik, unlike, in Delphi, Forms are tightly integrated with data sources. This means that the Forms themselves offer special services which can be used to create data driven interfaces, without requiring any special controls.
Forms in Morfik have bands and behave in a manner which can be considered to be a cross between a plain Delphi Form and a report.
Continuous Forms are specially good for displaying lists of items in Morfik applications. These Forms repeat their details bands for each record/row in a table or in the result set of a query.
[edit] Tables and Queries
Tables and queries are first class citizens in the Morfik AppsBuilder IDE. Instead of being represented by control icons on Forms or Data Modules, queries and tables are created separately and can be accessed from anywhere in your application.
[edit] DLLs and Function Libraries
Though you can call DLL functions from the server side of a Morfik application, if you wish to make a group of functions available to several of your applications you would do so by creating an application that publishes a Web Services interface.
Morfik Plug-in applications are in fact DLLs which are dynamically loaded by a Morfik Host Application Server. The plug-ins can, optionally, also be used with IIS or Apache directly.
[edit] Data Modules
If you are looking for data module-like functionality, have a look at "Where are the Data Modules?".
[edit] Importing Delphi Code
Most Delphi code, which is non-visual in nature, can be reused in a Morfik AppsBuilder application, particularly in server side code. Appendix A of the Morfik Developer's Handbook covers this. If you are a FreePascal developer, you will be interested in knowing that most pure-Object-Pascal code can be directly ported to browser side code in Morfik as well.

