StaffCoder
.NET
.NET.NET 10
12 modules · 48 challengesSign up
Modules12 modules · 48 challenges
Learn how a container is taught to build things it cannot construct on its own: registering a service through a factory delegate that decides at resolve time, telling several implementations of one interface apart by key, registering an open generic once so every closed type resolves from it, and keeping the lifetime each consumer gets correct.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Factory-Based Registration

Sign up to unlock
—No data yetmedium
About this challenge

This problem covers wiring up a service whose starting value is only known once the application is running, by handing the container a piece of code that builds the service instead of a ready-made object.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Keyed Payment Providers

Sign up to unlock
—No data yetmedium
About this challenge

This problem covers wiring up several payment providers that share one interface so the checkout picks the right one for the payment method it was handed.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Open Generic Repository Registration

Sign up to unlock
—No data yetmedium
About this challenge

This problem covers wiring one storage class so that every kind of record in the application can be stored through it, instead of repeating the same wiring line for each new kind.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Pluggable Export Engine

STAR
Solving it completes the module
—No data yetmedium
About this challenge

This problem covers wiring up a set of report exporters so the right one is picked for the format that was asked for, the whole set can be listed, and the one that needs a value only known at run time is still built correctly.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.