{"id":18378401,"url":"https://github.com/choonchernlim/spring-modularizer","last_synced_at":"2025-04-11T08:27:31.821Z","repository":{"id":147258077,"uuid":"166461798","full_name":"choonchernlim/spring-modularizer","owner":"choonchernlim","description":"Transforms an input object into a modularized result object based on the requested data module(s).","archived":false,"fork":false,"pushed_at":"2019-01-22T21:31:09.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T22:42:41.379Z","etag":null,"topics":["data-structures","design-patterns","groovy","java-8","spring"],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/choonchernlim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-18T19:26:36.000Z","updated_at":"2019-01-22T21:29:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"012c4a60-ba88-4d85-bcff-d6ada60d707d","html_url":"https://github.com/choonchernlim/spring-modularizer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choonchernlim%2Fspring-modularizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choonchernlim%2Fspring-modularizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choonchernlim%2Fspring-modularizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/choonchernlim%2Fspring-modularizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/choonchernlim","download_url":"https://codeload.github.com/choonchernlim/spring-modularizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248361244,"owners_count":21090847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-structures","design-patterns","groovy","java-8","spring"],"created_at":"2024-11-06T00:33:30.327Z","updated_at":"2025-04-11T08:27:31.778Z","avatar_url":"https://github.com/choonchernlim.png","language":"Groovy","readme":"# spring-modularizer [![Build Status](https://travis-ci.org/choonchernlim/spring-modularizer.svg?branch=master)](https://travis-ci.org/choonchernlim/spring-modularizer) [![codecov](https://codecov.io/gh/choonchernlim/spring-modularizer/branch/master/graph/badge.svg)](https://codecov.io/gh/choonchernlim/spring-modularizer)\n\nTransforms an input object into a modularized result object based on the requested data module(s).\n\n## Maven Dependency\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.choonchernlim\u003c/groupId\u003e\n    \u003cartifactId\u003espring-modularizer\u003c/artifactId\u003e\n    \u003cversion\u003e0.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Motivation\n\nTo provide an ability to enrich the result object by adding more data modules over time without introducing too many cross cutting concerns.\n\n\n\n```text\n---------------------------------------------------------------------------------------------------------\n     INPUT DATA               TRANSFORMATION                                  RESULT\n---------------------------------------------------------------------------------------------------------\nORM entity, ID, etc.     Either cherry-picking from         Result object that can be sent back to the \n                         input object or query against      user either as object, JSON or XML.\n                         data source(s) to construct        The fingerprints allow the user to quickly \n                         requested module(s).               determine whether the values have changed \n                                                            or not.                                                                   \n                                                      \n                                                      \n                                                             {\n                                                                \"id\": \"\u003csome-id\u003e\",\n                                                                \"fingerprint\": \"\u003csome-fingerprint\u003e\"\n                                                                \"a\": {\n                                                                    \"fingerprint\": \"\u003csome-fingerprint\u003e\",\n                              ✓ [ Mapper A   ]                      \"prop-1\": ...\n                                [ Mapper B   ]                      \"prop-2\": ...\n    Input Object    ---\u003e      ✓ [ Mapper C   ]        ---\u003e      },\n                                [ Mapper D   ]                  \"b\": null,\n                                [ Mapper ... ]                  \"c\": {\n                                [ Mapper Z   ]                      \"fingerprint\": \"\u003csome-fingerprint\u003e\",\n                                                                    \"prop-3\": ...\n                                                                    \"prop-4\": ...\n                                                                },\n                                                                \"d\": null,\n                                                                ...\n                                                             }\n```\n\nAt high level, the code looks something like this:- \n\n```groovy\nSet\u003cSomeModule\u003e selectedModules = [ SomeModule.A, SomeModule.C ]\n\nSomeEntity entity = // query from DB, etc\n\n// autowired `modularizerService`\nSomeResult result = modularizerService.create(entity, selectedModules, SomeResult)\n```\n    \n## Real World Example\n\nRun `Main.groovy` under [\"example\" package](src/test/groovy/example) and play around with it.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoonchernlim%2Fspring-modularizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchoonchernlim%2Fspring-modularizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchoonchernlim%2Fspring-modularizer/lists"}