-
Notifications
You must be signed in to change notification settings - Fork 11
Architecting shared code #70
Comments
We edit the libraries in their own environment, that way they will get proper PRs / unit tests / CI etc. Then when happy bring it back in to the apps. We don’t do the full SemVer setup for them, we’re not big enough to warrant it. This approach isn’t the fastest - but it’s the best contained, each lib have their own constraints and their tests should help it be the best it can for it's abstraction. Skipping that process in order to speed up dev on the app would end up meaning shortcuts would be taken from the libraries perspective. They’re also really important as atomic projects. Especially if multiple apps rely on it. So far we've avoided a meta “ArtsyKit” style project, I think it’s easier to work from smaller components then to try and wrap everything into a single shared project. Especially given how hard 3rd party tooling can be due to Apple in the Cocoa world. It also means we don’t have to keep updating one library, none of our libraries are actively built, they get a day or two of effort occasionally. Then sit untouched for months, meaning that the app gets the work done. |
Right....that makes sense. I suppose it falls a bit into the 'Just dont do that' bit mostly... (meaning work on the underlying dependencies from the main application). Combined with the POSSIBILITY that I may have over-engineered the architecture a tad. 🤓 But it is nice to have such small projects with shared code, even if I rarely (if ever) use my 'Networking' code without my 'Authentication' code. I could alter my setup by using the existing cocoa pods from a private Specs repo, and stop using the git submodule part of it. That would simplify the SHA updating nightmare, and if it works out, great, if not I can always go back to using development pods. The other wrinkle is that this shared code was written a while ago, and is inside static libraries (which prevents me from adding Swift). I really need to redo the architecture such that I can write shared Swift code, so if I was going to make larger changes to how the code is organized, it would be good to align it with that change. Thanks for the feedback, and anyone else reading this, I'd appreciate any other comments! |
Yeah, switching to support frameworks took us a bit of time due to needing to make sure all our deps ( Eigen has ~50 CocoaPods ) support frameworks. In the end though it was just a part of building our apps, and we could do it once and get it working in 4 apps. I don't think there's a perfect answer for any of this, I know tumblr are pretty happy with their TumblrKit, style approach similar to what you're talking about, as are Yahoo finance. However they are big enough to have a team devoted to those kind of core projects as opposed to our 1 app 1 developer. |
Remembered that I wrote a bit about this too: http://artsy.github.io/blog/2015/09/18/Cocoa-Architecture-Dependencies/ |
Right, I suppose its a balance between the logistical work of managing those dependencies, the scalability of the architecture if the team grows, and the speed of prototyping new projects with shared code. As you say, no perfect answer. I may have optimized a bit too far towards scalability & prototyping at the cost of a submodule SHA nightmare! Anyway, thanks for the thoughts! |
Jeff Verkoeyen ( three20 / nimbuskit / google material for iOS ) wrote about this topic too, http://design.featherless.software/on-retiring-shared-code/ |
The text was updated successfully, but these errors were encountered: