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
Proposal for mobile SDK top level overview #6
Conversation
sdk/overview.md
Outdated
|
||
### General requirements | ||
|
||
SDK should relay on reactive (RX*) api used for internal communication between SDK components. On each platform can be implemented using RXJS, RXJava etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/s/relay/rely
So one core question to this is do we want to expose Rx* APIs in our APIs? In general I am a "no" on that question. Rx can be a implementation detail however.
In Android a lot of the community uses RxJava and RxAndroid. If we include it as a dependency then we end up having to be very careful about dependency management. There are two ways that come to mind to handle this.
The first way is that we enforce some kind of default dependency version (Maven BOM) to avoid potential collisions. It is overrideable so savvy developers can include their own libraries instead of ours and test for breakages themselves. I think this should be the default.
The second way is we shade the Rx* namespaces. This way we don't have to expose ANY information about RxJava and users' are free to choose whichever version they want. This is a lot more complex however.
Can people chime in about other platforms? @danielpassos do you have thoughts on iOS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So one core question to this is do we want to expose Rx* APIs in our APIs?
No. It will be internal.
This is really valuable comment. Maybe we should keep SDK's without many external libraries and avoid using user level libraries like rx?
The last thing we want is to have some poor user experience and dependency collisions on users projects. Those can happen for both Android and IOS.
Good summary of options for IOS: http://blog.sigmapoint.pl/avoiding-dependency-collisions-in-ios-static-library-managed-by-cocoapods/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking to remove this restriction and do not mention RX for the moment, but the same problem may happen again with other dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 on removing this. It is the implementation details for each SDK, not a high level architecture design.
@secondsun Let's bring #2 changes here for full overview. |
@wtrocki On it. |
sdk/overview.md
Outdated
For most efficient automation single repository per platform is recommended. | ||
Repository will contain all related services source code, core module, deployment automation, documentation etc. | ||
|
||
### Platform specific requirements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally I think these things should be covered separate proposals. Based on the things here, there should be at least one per platform. In the proposal, it should dive into the implementation details of some of the things here. I am not sure if all of these things have anything to do with the high level architecture of the SDKs.
sdk/overview.md
Outdated
#### Git hosting | ||
|
||
For most efficient automation single repository per platform is recommended. | ||
Repository will contain all related services source code, core module, deployment automation, documentation etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any examples? how does this affect the high level architecture design?
@wtrocki Thanks for starting the discussion. I know this proposal is still work in progress, but want to give some early feedbacks.
Maybe I misunderstood the goal of the proposal. If that is the case feel free to correct me. |
@wei-lee Really good points. Thank you for review.
I agree. I will add more details. How will be done per platform as it will be in implementation details.
It is overview for SDK and it may be moved to separate proposals at any time. I personally wanted first to buy everyone into idea of having separate core sdk.
This is to make sure that all platforms will have this elements covered. I'm investigating IOS at the moment by checking how we can reuse current code. What work is required. @secondsun Is covering android. We going also to cover JS/Cordova/Web/ReactNative sdk by checking how current 5.0 libraries work and what is required later. As content will grow we can move this to separate proposals. For example: TL;DR - Proposal lists common areas and key decisions for our SDK. |
I think this is another thing needs to discuss with the team. I am not sure if it's a good idea to try cover the design of ALL the platforms right from the beginning, given that we haven't implemented any one of them. Personally I would like to see both teams focus on 1 platform first - maybe JS, or Android. We can apply the architecture you have suggested during the implementation, and see how it works. Then based on that, at the end of that, we can decide what things we have done right, what we haven't, and try make sure we do not make the same mistake when implement the next one. Another benefit of this approach is to keep both team focus on 1 platform at a time, so that we can all review each other's work and not distracted by different platforms. |
|
||
# Proposed Solution | ||
|
||
Modular SDK For SDK that can contain multiple non related services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand this sentence can you elaborate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It's not clear. Going to correct that.
This refers to the services available on the backend - like security, sync etc.
Those can be used separately or in the bundle.
|
||
Modular architecture is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality. | ||
|
||
Modular architecture is well known as practice for the server side development, but it can be also applied when building mobile SDK. In modular mobile SDK, code can be divided into separate packages that can be used separately by specific platform package manager. Each package depends on core package that needs to be added as separate dependency. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this similar to how Angular 2 does things now? It sounds very similar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This aligns with how Google Firebase, Amazon AWS or many other companies split their SDK's now. Angular2 is also very similar, but it has much more modules, with core being lightweight and separate modules for http etc.. To avoid overhead we assume that networking logging etc. will be in core.
|
||
This technique applies especially for large SDK’s that will implement clients for multiple not strictly correlated services. | ||
|
||
Having top level SDK allows developers to provide fluent api (different forms of the top level api that can be swapped and extended). Modular architecture also enforces good programming patterns. Networking, Logging etc. are loosely coupled with the service which allows developers to swap implementations with their own favorite network or logging library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having top level SDK allows developers to provide fluent api (different forms of the top level api that can be swapped and extended)
Would be good to get some code samples or sudo code examples here to make it clearer
IMHO That's very good idea. I was under impression that we should have all SDK's finished when service is ready and released to community. It will be better for us to deliver only one platform initially, but that will need wider agreement. If we agree on this - starting on Android makes sense as we all are experienced in this platform. |
I think limiting it to investigation work is ok? Using a modular system similar to how angular approach dependencies seems solid as a principal however I think the boundaries on the modules needs to be clear. Also it is not completely clear to me whether there is a module per service and also many shared modules for logging, network etc? |
Thank you so much for valuable comments. Tasks
|
Separate proposal was created. Closing. |
Follow up POC will be done as part of https://issues.jboss.org/browse/AGDROID-678 |
Proposal for top level mobile SDK architecture.
Moved from investigation document.
See source if you want to know reasons for proposing this architecture.