-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Pre-DIREGAPIC refactoring (#735)
Prepare `gapic-generator-java` for the DIREGAPIC implementation changes. 1) Splitting Grpc-specific classes into their own package (mainly `composer` classes) 2) Extract the transport-agnostic logic of the composer classes into the set of abstract classes. 3) Convert most of the static methods in the `ClassComposer` classes into instance methods to leverage the class inheritance (transport-agnostic logic in abstract class, transport-specific portions are in transport-specific classes extending the abstract ones) 4) The resultant architecture resembles the [Template Method](https://en.wikipedia.org/wiki/Template_method_pattern) design pattern where `Abstract<Name>ClassComposer.generate()` (and potentially the the other private/protected methods called from `generate()`) call transport-specific logic (implemented in the concrete `<Transport><Name>ClassComposer` classes), when appropriate. 5) Refactor the tests and golden files file structure to match the main classes package structure. 6) The golden files were split to be placed under the same directory as the clases which generate them. This was matching the existing infrastructure the best: (1) as the golden files updater makes this assumption (golden file is under the same package as the `<Name>Test.java` which creates it); (2) the repo currently does not have a dedicated test resources directory (there are multiple resource-like subfolders under test, it is hard to keep thing under control and avoid propagating magical path constants); (3) keeping golden files and tests together seems ok, since if the golden files were smaller they would be simply put as the expected constants in the tests themselves. 7) This PR tries to preserve the original history of the files as accurately as possible (i.e. prioritizes clear move semantics over delete/create semantics in terms of file diff, where possible). The subsequent PR with rest implementation will looks something like [this](vam-google/gapic-generator-java@master...vam-google:diregapic_main)
- Loading branch information
1 parent
44a42a0
commit 04c2faa
Showing
92 changed files
with
2,940 additions
and
2,043 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.