Emerging Health System(EHS):
URL Mapping:A completely different implementation that I came across. The system uses various front controllers(Dispatcher servlets) such as
Ajax Servlet
Upload Servlet
Image Servlet
Web Servlet: Main servlet for dispatching requests to other EJB objects.
All other servlets except WebServlet have the similar and self-explanatory task of dispatching requests.
Web Servlet(DADA Servlet): This instead of mapping requests through a config file(eg: xml), approach uses a combination of Java's Reflections and Database Table to dynamically execute methods on classes based on request parameters.
The solution is designed in such a way that the requests from front-end contain a static path eg: http://Host:port/ehs/ehsdadaservlet along with parameters.
The URL: /ehs/ehsdadaservlet is mapped to Web Servlet(Dispatcher).
WebServlet then invokes a ProcessHandler by passing it the HttpRequest for further processing.
The request-parameters contain information of which EJB and its method need to be invoked.
The ProcessHandler takes in the request, extracts the parameters, validates the values against database table to fetch appropriate class and its method. And then it invokes the classes and method dynamically with the help of Reflections.
Here the process handlers cannot be called as Controller as in MVC since they don't dispatch back the response.
Front End:
The development of frontend webpages is done via a software called ToolKit. It has a GUI that contains all UI elements which can be dragged and dropped to design webpages and can hook JavaScript methods to events of UI elements.
Once designed, the whole logic is stored in database tables. There are UI Process-handler classes which dynamically construct HTML pages(View) extracting from db, attach the XML data(Model) received from EJBs and render them back to client.
DAO and Service layers:
As part of persistence, no Hibernate or ORM tool is used rather they directly invoke Stored procedures from Service layer bypassing DAO layer.
A tool called Query builder(Similar to HQL) is used to avoid directly coding SQL queries. The objects compatible to be written in QueryBuilder queries need to be generated automatically by another in-house tool.
MasterData Managment:
Any application(Web based or desktop) that interracts with Users, should have the master data configured in the database and corresponding UI to pull and save data back-and-forth.
The practice followed in this project is somewhat less niche. In the previous projects, we used to maintain the config data in seperate tables here they maintain all the data in a single table calling it ControlCodes.
Eg:
Visa Meta data: will be in a table with Country, Visa Name, Class, Sub class etc
Address related meta data: Country, City, State, PostalCodes, etc
Seperate UI is designed to maintain this data.
But here in EHS, they configure all the data in a single table and maintain a single UI to manipulate the data. Though the adavantage of having single UI for whole management, lot of wastage will be there in terms many table columns being NULLs.
Imagine maintaining Visa metadata, Address meta data, any other configuration data in a single table. Though the data might be less, lot of columns will be NULLs resulting wastage of storage space.
These practices are highly unmaintainable in the long run.
No comments:
Post a Comment