Black Puppy's Blog

Friday, May 13, 2005

Clarion/Fenix is inappropriate for ASP.NET application

Note:
Part of the content comes from an email to my colleagues.
Clarion is a 4GL RAD to develop business application using template to generate code based on data dictionary.
Fenix is a set of Clarion template to generate ASP.NET code.

Fenix is a brilliant idea for Clarion developers who want to create ASP.NET web application or who want to make use of the existing data structure defined a Clarion data dictionary. But for those who want to create ASP.NET application from blank, in my opinion, it is not a good choice.

Clarion/Fenix is not aware of .NET namespace. .NET allow the classes in different namespaces have the same name but will not cause a conflict. You can always use the fully qualified class name to identify which class you are using. But in Clarion the code generated by the template cannot be edited. You have to use embed code to comment out the code generated by template, and then manually add code using the fully qualified class name.

Another problem is how to divide the namespace in our project. Namespace is similar to the Java package. The code generated will all be put under the namespace Fenix.TableManagers. I do not know how to specify my own namespaces for the classes instead of Fenix.TableManagers. For example, the classes I created in my work should be put inside a namespace representing my company such as CompanyName. A possible namespace scheme is shown below.

  • CompanyName.ProjectName.Web - ASP.NET pages
  • CompanyName.ProjectName.Model - Business objects
  • CompanyName.Util - Miscellaneous helper/utility classes

This will help partition the system and enable the reuse of the code we've developed. For example, if we need to add a Windows UI or a Web Service interface, we can add a new namespace Win/WebService under CompanyName.ProjectName and reuse the business objects in the namespace CompanyName.ProjectName.Model. The utilities inside CompanyName.Util can also be used in other projects.

We can divide the whole solution into several projects instead of putting everything inside one project. If the project becomes bigger, we can have more sub namespaces under CompanyName.ProjectName.Web/Model.

Another bad thing is that it equals the object model to the data model because Clarion is used to develop data centric application. For a complex enterprise application, they are usually not the same. In the database, the relationship between entities is reflected by a foreign key. In the secondary table, there will be a field referring to the primary key field of the primary table. While in the object model, the relationship is reflected by association/aggregation/composition relationship. And basically that is just to use a object reference. In the secondary object, there will be a reference to the primary object instead of having a field corresponding to the identity field of the primary object. But the code generated by Fenix is not like that.

Furthermore, FlowLayout instead of GridLayout should be used for web application. In VS.NET 2005, the default layout will be the FlowLayout. I think it means Microsoft recommends you to use FlowLayout. This is a better layout for web pages because you cannot know in advance the screen layout and resolution of the users. FlowLayout will make the web page content more adaptable to suit the user's local settings. In addition, the page using GridLayout cannot be easily converted to use master page in VS.NET 2005.

Other errors/shortcomings.
  • Microsoft.VisualBasic.Collection is used. Wrong. Should use System.Collections.Collection instead.
  • DataSet used as a counterpart of Clarion QUEUE. Wrong. Too much overhead.

0 Comments:

Post a Comment

<< Home