vendredi 6 septembre 2019

Design approach compared to others

I am asking about best practices or industry standards.

I am new to enterprise level software solutions and Spring. I came into a job where I was assigned to a project that has had many hands working on it (both before I got here and while Im here) and it has not yet been finished being developed (but getting close).

One of the tasks was about some common lookup tables (CLT). I was to display the counts of when these tables had new, updated, or in-activated records, and when that count was clicked, show those records on another page. I did not feel that creating one to three views per CLT was a good practice, so I designed a flexible view that would take in a page title, an array of headers, and two dimensional array of table data. As each CLT had the same behavior this simplifies certain aspects compared to ones that do not have shared behavior.

I liked the idea of a common component so I tried to extend the design. What I eventually created was a class which would hold the CLT name, its three counts, and two strings, both which would be used to query the database, one for headers, and the other for the table values. From this common class structure, I was able to have a single call across the application which would display the CLT count table, and when clicked would display the headers and values specific to it. I was able to get the CLT's functioning where they only use a single chain of functions across the application. Adding or removing CLT's, changing headers, and changing table content could all be accomplished via the database without having to touch the application. The list of CLT's was stored in a table, and the stored procedure for the headers simply returned a cursor of those headers, and the stored procedure for the table values also returned a cursor.

As I am not the only developer on this project, others have done parts in different ways. When I see their code, every part is its own coding with very little overlap for reuse. When their controller is called, it calls a distinct function in the service layer, which calls distinct functions in the pojo and dao layers, and the dao uses a specific mapper. Lots of distinct pojos and mappers despite the project using the same data in different ways.

Was I wrong to go about designing the CLT's in the way I did? The approach I took to it does not resemble what was done in the other parts of the application, and from a maintenance point of view, does this not increase the difficulty of keeping it running?

Aucun commentaire:

Enregistrer un commentaire