![]() Our standard scope hierarchy is an app-scope component plus org-scoped and user-scoped subcomponents of it. dagger-android has the benefit of intrinsic Dagger support though, so it wouldn’t be as easy for us to have Dagger auto-magically wire things for us. This is something dagger-android handled nicely for us with AndroidInjection.inject(), so we wanted to arrive at a solution that got us a similarly simple touch point. This can be done by hand but it’s tedious, error-prone, and leaves us with a long list of inject() functions in corresponding components. While most injected types can just use constructor injection or assisted injection (such as fragments), activities are a special case as they can only use member injection and require something to inject them in onCreate(). We still want to move off of dagger-android though, so we needed to devise something that played to our existing structure. Our stack is very particular (we don’t have notions of activity-scope or fragment-scope), so building upon low-level Dagger APIs rather than adopting a new opinionated framework was a better solution for us. As such, most of our activities were wired via While Hilt is the canonical successor to this, we’ve opted not to adopt it for a few reasons specific to our codebase. We historically used dagger-android, which is now deprecated. In this post we’ll detail a little of how it works with our own Activity injection pattern as an example. Every codebase has its own patterns and nuances, so Anvil 2.3.0 introduced a new compiler-api artifact that allows us to extend Anvil’s own code generation to suit those remaining needs. Factory generation alone recently helped us reduce our incremental build times by as much as 25%!Īnvil’s core features are fantastic, but they are not (nor pretend to be!) turnkey solutions for every use case, though they cover the common ones. Factory generation enables us to remove kapt from much of our project, and allow us to automatically wire dependencies without modules, and allows us to automatically wire together component interfaces. It slows down our builds with kapt, has a steep learning curve, and can often be tedious to write out its module+component plumbing.Īnvil augments Dagger’s own boilerplate. It’s powerful, flexible, supports basic Kotlin idioms, and allows for advanced dependency injection patterns with less boilerplate. We use Dagger heavily in the Slack Android app for compile-time dependency injection. That's where I did a hardness test and it came out at about 50RC.Īlso there are some holes that appear to be imperfections in the top working surface.Note: This article assumes some familiarity with Dagger, Anvil, and Kotlin. There is a little black spot on the top working surface near the front edge. I have taped off the measurements in inches hoping someone might be able to tell me approximately how much it weighs, heavy yes I know but I haven't been able to lift it and step onto the bathroom scale. It has a coat of black paint on it and I haven't wanted to remove that, wanting to keep it original. ![]() I would have expected to see a cast in logo on the side or something similar but both sides are just rough cast iron, assumed cast. I haven't been able to find any makers name on it. I own a fairly good sized anvil that has more nostalgic value to me than monetary but I don't know anything about it and hope that perhaps some of the anvil experts can help. I was surprised when I read the recently submitted thread " What Steel to Use for Casting an Anvil" that there was so much knowledge and passion regarding anvils amongst the PM group.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |