Bread:...jection(3pm)
π Bread::...jection(3pm) π
okay bestie, this is a page from the User Contributed Perl Documentation β the manual name is literally Bread:...jection(3pm), yes it's abbreviated, yes it's iconic, we move. sit down, grab a strawberry, let's talk about setter injection. πβ¨
β¨ NAME β¨
Bread::Board::SetterInjection β a service that instantiates objects via setter functions. no cap, that's the whole vibe. π
π VERSION π
version 0.37 β periodt.
π¦ DESCRIPTION π¦
so the way this works is: this service class instantiates objects by calling new on a class, and then β plot twist β it calls setters on the object it just got back. it's giving "build first, decorate after." π
this class consumes these three roles, all of them, every single one:
Bread::Board::Service::WithClassBread::Board::Service::WithParametersBread::Board::Service::WithDependencies
π ATTRIBUTES π
π class
this attribute is provided by Bread::Board::Service::WithClass. but here's the thing, bestie β this service makes it a required attribute. and honestly? fair. you literally cannot call a constructor if you don't have a class. that's not a hot take, that's just facts. π₯
β METHODS β
πΈ get
this is the main character method, obviously. here's the tea:
- it calls the
newmethod on theclassto get the object to return π«Ά - then, for each of the service parameters, it calls a setter with the same name as the parameter, passing it that parameter's value β¨
so like. parameter named foo? boom, setter called foo gets the value. matching names only, iykyk. π
π§ AUTHOR π§
Stevan Little <stevan@iinteractive.com> β the icon, the legend, the moment. π
π BUGS π
please report any bugs or feature requests on the bugtracker website:
https://github.com/stevan/BreadBoard/issues
also, when you're submitting a bug or a request, please include a test-file β or a patch to an existing test-file β that illustrates the bug or the desired feature. like, help us help you, bestie, we're begging. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2019, 2017, 2016, 2015, 2014, 2013, 2011, 2009 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π«Ά
and that's the whole page, bestie β no notes, ate and left no crumbs. this was rendered with perl v5.36.0 on 2022-12-12, filed under Bread:...jection(3pm). mwah, love u, go build something. π
ππ
π¦ where this page comes from
- debian bookworm: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbread-board-perl 0.37-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libbread-board-perl 0.37-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms