We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Scratch the data layer
Clean up and redesign a data layer of flank to make it more visible also easier to understand and scale.
api
object
data class
ftl.adapter
The description of how to solve each similar issue in practice, using #1740 as an example.
Add abstraction to the data package.
Create new file ftl/data/UserAuthorization.kt. With body:
ftl/data/UserAuthorization.kt
package ftl.api val requestUserAuthorization: UserAuthorization.Request get() = TODO() object UserAuthorization { interface Request : () -> Unit }
Move all implementation that will be covered by abstraction to the proper subpackage of ftl.adapter.
Consider the:
ftl/gc/UserAuth.kt
ftl/config/Credentials.kt
As wrappers for third-party API, that could be easily adapted to the data interface.
Make sure the list above is complete, if not take also missing files into an account.
Move wrappers to dedicated sub-package in ftl.adapter.
ftl.client.google
Add new implementation for added abstraction.
Create new file ftl/adapter/GoogleUserAuthorizationRequest.kt. With body:
ftl/adapter/GoogleUserAuthorizationRequest.kt
package ftl.adapter import ftl.client.google.UserAuth import ftl.api.UserAuthorization object GoogleUserAuthorizationRequest : UserAuthorization.Request, () -> UserAuthorization by { UserAuth().request() UserAuthorization }
Update file ftl/data/UserAuthorization.kt with:
val requestUserAuthorization: UserAuthorization.Request get() = GoogleUserAuthorizationRequest
Replace old API wrapper calls with new abstraction usage.
Update file ftl/domain/LoginGoogleAccount.kt with:
ftl/domain/LoginGoogleAccount.kt
package ftl.domain import ftl.api.requestUserAuthorization interface LoginGoogleAccount operator fun LoginGoogleAccount.invoke() { requestUserAuthorization() }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
SDD
Scratch the data layer
Motivation
Clean up and redesign a data layer of flank to make it more visible also easier to understand and scale.
Goals
Non-Goals
Design
API
api
abstraction as Kotlinobject
ordata class
.api
abstraction is a context of specific operations on data.api
context is grouping all related structures or interfaces under its namespace.api
package.Adapter
Steps
api
package.ftl.adapter
.Example
The description of how to solve each similar issue in practice, using #1740 as an example.
Step 1
Create new file
ftl/data/UserAuthorization.kt
. With body:Step 2
Consider the:
ftl/gc/UserAuth.kt
ftl/config/Credentials.kt
As wrappers for third-party API, that could be easily adapted to the data interface.
Make sure the list above is complete, if not take also missing files into an account.
Move wrappers to dedicated sub-package in
ftl.adapter
.ftl.client.google
for the wide scope of Google-related API wrappers.Step 3
Create new file
ftl/adapter/GoogleUserAuthorizationRequest.kt
. With body:Update file
ftl/data/UserAuthorization.kt
with:Step 4
Update file
ftl/domain/LoginGoogleAccount.kt
with:The text was updated successfully, but these errors were encountered: