0% found this document useful (0 votes)
14 views3 pages

Best Practices

Uploaded by

gunagunas728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Best Practices

Uploaded by

gunagunas728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Findings

String httpUrl = "http://CMC-DOCUMENT-SERVICES/cmc-document-services/service/v1/documents/

httpHeaders.add("entityId", "DEFAULTENTITY");postConnection.setRequestMethod("POST");
postConnection.setRequestProperty("Content-Type", "application/json");
postConnection.setDoOutput(true);
postConnection.setRequestProperty("userId", headerDTO.getUserId());
postConnection.setRequestProperty("branchCode", headerDTO.getBranchCode());
postConnection.setRequestProperty("appId", "OBAC");
postConnection.setRequestProperty("authToken", "Y");
postConnection.setRequestProperty("entityId", "DEFAULTENTITY");

BaseScreenClassOrchestratorRepository(Implementation Logic is presented in Interface layer)


BeanUtils.copyProperties(srvTwBcFunctionPref, srvTmBcFunctionPrefDTO) ;

SrvTbActions named query


System.out.println should not allow / SrvTbActions
We should go with @Data annotation
Logger Is not implimented correctly
Exception Handling

Multiple object created for date/time class

Optional Exception
Native Query/purgeLogs(insert into CMC_RH_AUDIT_EVENT_LOG_HISTORY/delete from CMC_RH_AUDIT_EVENT_L

Method name and return http status code not in sync


War/ClassName

obremo.rpm.cmn.hostservices/DocumentServiceUtilImpl

PlatoInterceptor in all war file


obremo.services.srv.branchcommon/BaseScreenClassOrchestratorRepository
obremo.services.srv.branchcommon/RemoTmBranchChargeMasterAssembler line 99

obremo.services.adapter.service.OBPayTxnLogServiceImpl
common query
common query
common query
(Exception e)

common query

oracle.fsgbu.cmc.services.obrh/purgeLogs,BaseAuditEventService/nativeQueryBuilder.ap

oracle.fsgbu.obremo.services.srv.adapter.web.api.CustomerWebApi
Remarks
Instead of hardcoding the static URL at the Class level, we can have the same at the table level which will help in a la
We already did that for the RoutingHub table.

Hard code value should be replaced and we can have the same in the database. So, that it will be dynamic.
For example:
entityId is hardcoded as "DEFAULTENTITY" across the business logic.
appId is also hardcoded, which we can get from the database.
Business logic should remove from interface layer and It should be in Implementation Layer.
In all the war files, object dto is framed by setting it one by one. Instead, we can use BeanUtils. copy-properties to se
getUrlById @NamedQueries({@NamedQuery(name = "SrvTbActions.getUrlById", query = "select o from SrvTbActio

Instead of using the named query, we can use the findById method to do the same operation in hibernate, which wi
We should use logger info, instead sysout.
To reduce the line of code for getter and setter in all POJO classes, we can go with @Data Lombok dependency to op
In most of the functionalities, the logger is not implemented properly and we're facing difficulties in encountering th
Instead of having a Generic Exception (Exception), we can define some specific user-defined exception and error me

OBPayTxnLog obPayTxnLog = new OBPayTxnLog();


obPayTxnLog.setRequestDateTime(new Date());
obPayTxnLog.setResponseDateTime(new Date());

Date/Time should move to common method/util and can be reusable over the project
To handle the Null pointer condition, we can have the exception using the Optional type.

Remove Native query from class like they have provided insert and delete query
getCustomerInfo - @ApiResponse(code = 201, message = "Create RT FCUBS Cash Withdrawal description", response
For fetching(GET-call), the HTTP status code should be 200.
Also, in the branch-common CREATE - orchestrator call, the HTTP status code is 200, instead of 201.

You might also like