Opened 11 years ago

Closed 7 years ago

#502 closed enhancement (fixed)

ORM in petascope with Spring Boot

Reported by: Piero Campalani Owned by: Vlad Merticariu
Priority: critical Milestone: 9.5
Component: petascope Version: development
Keywords: refactoring dbmetadatasource gmlcov Cc: Vlad Merticariu, Dimitar Misev
Complexity: Hard

Description (last modified by Bang Pham Huu)

Updated: Petascope will change to use Spring to make the legacy code easier to maintain, especially the Data Access Layer which is dependent to Postgresql which will use Hibernate to decouple.

Class petascope.core.DbMetadataSource is very fat, getting fatter. Its .read() method especially.
On one side there is the need for a more handy interface with the database (maybe through Java persistence APIs, or some other ORM).

Additionally, there is the need for a new supporting package which abstracts the GMLCOV coverage metadata (petascope.gmlcov ?), to avoid the extensive use of Java Lists and Maps and to support the creation of petascope.CoverageMetadata objects.

A linkage with class petascope.wcps.server.core.CoverageInfo to let WCS and WCPS have a single source of metadata information should be evaluated.

Change History (7)

comment:1 by Piero Campalani, 11 years ago

Additionally, petascope.CoverageMetadata needs restructuring: hierarchy should be exploited to reflect the tree of coverage types in GML, for gridded and multipoint coverages, and in case, for different grids.

comment:2 by abeccati, 11 years ago

Version: 8.5development

Does not look a requirement for 8.5 so moving to dev, version should be changed to whatever released version we have once it gets tackled

comment:3 by Dimitar Misev, 11 years ago

Complexity: HardEasy
Priority: majorminor

I was just going to open a ticket for this. There are a few rather large classes/methods that might be good to refactor at some point into smaller pieces, most notably the DbMetadataSource. E.g. (ignore the generated wcpsParser/Lexer though)

$ find -name '*.java' | xargs wc -l | sort -n -r
  81914 total
  21431 ./petascope/wcps/grammar/wcpsParser.java
   8777 ./petascope/wcps/grammar/wcpsLexer.java
   2200 ./petascope/core/DbMetadataSource.java
   1733 ./petascope/util/CrsUtil.java
   1276 ./petascope/wms/WmsRequest.java
   1145 ./petascope/util/XMLUtil.java
   1132 ./petascope/wms/WmsCapabilities.java
   1093 ./petascope/wcst/transaction/executeTransaction.java
   1020 ./petascope/wms/commander/Table_Service.java
    886 ./petascope/core/CoverageMetadata.java
    864 ./petascope/wms/commander/Table_Layer.java
    797 ./petascope/wms/RequestConverter.java
    774 ./petascope/PetascopeInterface.java
    756 ./petascope/wms/commander/Globals.java
    724 ./petascope/util/WcsUtil.java
    701 ./petascope/wms/commander/Table_ServiceLayer.java
    681 ./petascope/wms/WmsServlet.java
    674 ./petascope/wms/commander/Table_Style.java
    649 ./petascope/wms/WmsConfig.java
    627 ./petascope/wms/commander/Table_PyramidLevels.java
    505 ./petascope/wcs2/legacy/GetCoverageOld.java
    501 ./petascope/wcs2/parsers/GetCoverageRequest.java
    487 ./petascope/wcs/server/core/convertGetCoverage.java
    481 ./petascope/wcs2/extensions/AbstractFormatExtension.java
    481 ./petascope/wcps/server/core/Bbox.java
    468 ./petascope/wcst/transaction/tools/RasdamanUtils.java
    463 ./petascope/wms/commander/CommanderConnection.java
    427 ./petascope/util/StringUtil.java
    420 ./petascope/wcps/server/core/XmlQuery.java
    386 ./petascope/util/ras/RasUtil.java
    384 ./petascope/wcs2/parsers/GetCoverageMetadata.java
...

Should be low priority in any case.

Last edited 11 years ago by Dimitar Misev (previous) (diff)

comment:4 by Dimitar Misev, 10 years ago

Cc: Vlad Merticariu Alex Dumitru added
Owner: changed from Piero Campalani to Dimitar Misev
Priority: minormajor
Status: newassigned
Summary: DbMetadataSource and Coverageclass needs refactoringORM in petascope

comment:5 by Bang Pham Huu, 8 years ago

Cc: Dimitar Misev added; Alex Dumitru removed
Complexity: EasyHard
Description: modified (diff)
Milestone: Future9.4
Owner: changed from Dimitar Misev to Vlad Merticariu
Priority: majorcritical
Summary: ORM in petascopeORM in petascope with Spring Boot

comment:6 by Dimitar Misev, 8 years ago

Milestone: 9.49.5

comment:7 by Dimitar Misev, 7 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.