lundi 5 octobre 2015

Is it possible to encapsulate each small desktop GUI application in a class definition to assemble them as components, which can be easily replaced?

Does there exists any GUI platform (e.g. Windows-API, Apple’s Cocoa or Java/swing) for desktop GUI applications that allows (or supports a mechanism) to implement a small GUI application comprising many data driven GUI components in a class definition?

Let me explain this using an example. Assume if I need to create a City_GIS application containing several sub-components, which include a City_ATC (a component to display Air Traffic Control for the city), a City_Ambulances (a component to monitor ambulances), and so on. The air-planes and ambulances must update their locations every few seconds and clicking on the airplane/ambulance must make an Ajax call to get latest data and display in a Table.

I want to implement each component as an individual GUI application (i.e. in a GUI class), so that I can refine it and test it individually. Then I must be able to assemble each small GUI application implements as a class can be assembled by writing just two lines of code, for example:

    // Code needed to assemble City_ATC into the application is:
    RepComp AirTraffic= new CityATC_RCC (ACi, AirportCode); 
    ParentCanvas.AddChild (AirTraffic, 0, 0, null);

     // Code needed to assemble City_Ambulances into the application is:
     RepComp CityER= new City_Ambulances (ACi, ZipCode); 
     ParentCanvas.AddChild (CityER, 0, 0, null);

If this application has dozen such sub-components, I should be able to implement and test each as a small GUI application (in a class, which can be used to assemble this component). Each mini GUI application/class implements all the application logic and presentation logic. It must not take more than 3 to 5 lines of code to assemble each sub-component, and removing the lines must effectively remove the sub-component.

For example, the airplanes shapes must reflect model (e.g. B747 or AV 330) & must be colour coded to show in-coming, out-going etc. Each engineer responsible for each such component can refine his component continuously and/or frequently to add such features and test it individually free from spaghetti code. Since each mini-GUI-application/class can have an independent codebase (a set of files) and version control mechanism, he is not forced to see even single line of code implemented for another mini-GUI-application/class. That is, no spaghetti code for each component.

Although it is possible to create this kind of GUI library, I could not find any way for any existing GUI API to support this useful feature. I am absolutely sure that it is possible support this kind of feature, because we created a Java GUI library for creating such GUI classes that can be assembled to build complex data driven GUI applications for web (e.g. to run in web browsers).

You can see demo of such components by going to web site http://pioneer-soft.com and selecting: “DEMO” -> “Real CBSD” -> “Assembling Replaceable Components for Multiple Cities” (on the left side of the webpage). We created a Class for each city (by assembling objects of ATC & ambulances) & passed multiple objects to a Tab-component. Is this possible for desktop for any desktop GUI platforms?

Best Regards, Raju




Aucun commentaire:

Enregistrer un commentaire