-1

Lately I have been thinking about introducing some dependency injection into some projects and I am thinking: have any of you encountered any successful use of dependency injection framework/library in either CC, BC or PC, maybe you are using one yourself and have some good pointers? Do you think it is worth pursuing such functionality? Or it will only add unnecessary complexity ?

I have tried using one framework but it looks like there is no good point to attach it into the project. I really enjoy working with it and unit testing is quite impressively easy, but I wonder if that makes any sense especially if not everyone on the project will use it, so some parts of code will be with DI in place, some will not.

New contributor
Bartosz Tyczko is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    Commented Dec 10 at 17:22

1 Answer 1

0

I can't say this will be particularly useful to what you're trying to do, but the whole EDGE integration capability that supported the legacy Guidewire digital products (the non-Jutro ProducerEngage, etc products) is built on a dependency injection framework. That is tightly linked to the JSON-RPC entry point so it's not intended to be used in a more general sense but if you're looking for an example that's the best one generally available that I'm aware of.

For modern usage where the GWCP Cloud APIs are intended as the primary entry point into the IS applications that example isn't particularly useful or informative. If you can share more information about what problem you're trying to solve the community may have more feedback.

1
  • So basically I would like to inject dependencies with a framework to my custom code. Let’s say I can use guice for that. So I would be initializing injector as a singleton in a static variable to pass it through the project. And in classes where I can start my custom process I would use something like Injector.getInstance() and it would give me all dependencies that I need inside the class. And I am wondering if that is a bad design and not worth the increased complexity or is that something worth following ? Commented 2 days ago

Not the answer you're looking for? Browse other questions tagged or ask your own question.