Skip to content

Simplify factory provider #210

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

Merged
merged 2 commits into from
Dec 13, 2019

Conversation

ask4gilles
Copy link

proposal to simplify the PostgresqlConnectionFactoryProvider

@mp911de
Copy link
Collaborator

mp911de commented Dec 10, 2019

Thanks for your pull request. Moving the initialization into the Builder is an interesting option that would allow applications to pre-initialize the builder with ConnectionFactoryOptions. We probably should inline parts of the methods (such as not having an individual method per SSL option).

It would also make sense to expose builder(ConnectionFactoryOptions) statically to obtain an initialized builder instead of a method that applies ConnectionFactoryOptions to an existing builder. Applying some other configuration object bears always the risk that previously configured options get overwritten and by returning a pre-initialized builder, we're able to avoid this risk.

@mp911de mp911de added the type: enhancement A general enhancement label Dec 10, 2019
@ask4gilles ask4gilles force-pushed the simplify-factory-provider branch from 3ed95cc to ec59cff Compare December 10, 2019 13:41
@ask4gilles
Copy link
Author

Hi Mark,
I've pushed some modifications according to your remarks.

@mp911de mp911de added this to the 0.9.0.M1 milestone Dec 13, 2019
@mp911de
Copy link
Collaborator

mp911de commented Dec 13, 2019

Thanks a lot. While reviewing the code I realized that moving the initialization ConnectionFactoryOptions-based initialization to PostgresqlConnectionConfiguration.Builder causes a cycle between PostgresqlConnectionConfiguration.Builder and PostgresqlConnectionFactoryProvider as driver-specific options are declared in PostgresqlConnectionFactoryProvider.

I'm going to move the entire fromConnectionFactoryOptions(…) method tree back to PostgresqlConnectionFactoryProvider preserving the optimizations from the original pull request.

mp911de added a commit that referenced this pull request Dec 13, 2019
Move builder(ConnectionFactoryOptions connectionFactoryOptions) from PostgresqlConnectionConfiguration to PostgresqlConnectionFactoryProvider to resolve the class cycle.

[#210]
mp911de added a commit that referenced this pull request Dec 13, 2019
@mp911de mp911de merged commit 1090116 into pgjdbc:master Dec 13, 2019
@mp911de
Copy link
Collaborator

mp911de commented Dec 13, 2019

That's merged and polished now.

@ask4gilles
Copy link
Author

Thanks Mark!

mp911de added a commit that referenced this pull request May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants