Opened 4 years ago

Last modified 7 weeks ago

#502 assigned enhancement

ORM in petascope with Spring Boot

Reported by: pcampalani Owned by: vmerticariu
Priority: critical Milestone: 9.5
Component: petascope Version: development
Keywords: refactoring dbmetadatasource gmlcov Cc: vmerticariu, dmisev
Complexity: Hard

Description (last modified by bphamhuu)

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 (6)

comment:1 Changed 4 years ago by pcampalani

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 Changed 3 years ago by abeccati

  • Version changed from 8.5 to development

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 Changed 3 years ago by dmisev

  • Complexity changed from Hard to Easy
  • Priority changed from major to minor

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 3 years ago by dmisev (previous) (diff)

comment:4 Changed 2 years ago by dmisev

  • Cc vmerticariu mdumitru added
  • Owner changed from pcampalani to dmisev
  • Priority changed from minor to major
  • Status changed from new to assigned
  • Summary changed from DbMetadataSource and Coverageclass needs refactoring to ORM in petascope

comment:5 Changed 4 months ago by bphamhuu

  • Cc dmisev added; mdumitru removed
  • Complexity changed from Easy to Hard
  • Description modified (diff)
  • Milestone changed from Future to 9.4
  • Owner changed from dmisev to vmerticariu
  • Priority changed from major to critical
  • Summary changed from ORM in petascope to ORM in petascope with Spring Boot

comment:6 Changed 7 weeks ago by dmisev

  • Milestone changed from 9.4 to 9.5
Note: See TracTickets for help on using tickets.