galovics commented on PR #2285: URL: https://github.com/apache/fineract/pull/2285#issuecomment-1104864901
Even though the changes will work I have some concerns about introducing them this way. This is probably the first step where we want to add support for a native cloud database and since IAM authentication is used, the database URL will be different than in regular cases. Architecturally speaking, I'd envision a number of resolvers chained together. Each resolver can decide in which environment it's running in and create the appropriate datasource with all the configurations necessary. For example we could have the currently supported regular datasource in a `DefaultDataSourceResolver` or something. And then there's a `GcpDataSourceResolver`. All these resolvers are in priority order, namely the `DefaultDataSourceResolver` is the last one to be invoked. The first resolver "taking" the invocation and creating the appropriate datasource will stop the chain from continuing. That way, we can very well decouple specifics to certain environments to separate classes without polluting existing classes with a lot of if statements. What do you think? cc @vidakovic -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
