Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: Java MVVM #1

Closed
wants to merge 31 commits into from
Closed

Conversation

garrettjonesgoogle
Copy link
Owner

This PR includes the changes on top of googleapis#317 to support Java generation using the MVVM pattern.

This is still in progress and is not functionally complete yet.

This was prototyped in googleapis#268
for both Java and PHP; the present PR only includes PHP and shared
stuff.

The MVVM pattern uses the following steps:

1. The Model is converted to a ViewModel, which is a set of classes
containing the data to be used when rendering the templates.
2. The snippet engine renders the output using only data from the
ViewModel structure.

Other changes with the MVVM model:

* There is no context object when generating under the MVVM model. All
  data must be prepared beforehand.
* No casing changes are done in templates; all identifiers must be
  composed and cased correctly inside the view model.

There are a number of new utility classes created:

* Name: represents an identifier name which is casing-aware.
* TypeName: Represents a simple or complex type and keeps track of the
  aliases for the contributing types.
* TypeTable: manages the imports for a set of fully-qualified type
  names.
* SurfaceNamer: provides language-specific names or other strings.

There is also a change unrelated to MVVM:

* Using TreeSet for auth scopes to give a consistent ordering
@garrettjonesgoogle
Copy link
Owner Author

@bjwatson @shinfan

@garrettjonesgoogle
Copy link
Owner Author

Real commit was completed in googleapis@653b6f2 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant