Home > Software design >  Interface aggregation
Interface aggregation

Time:11-29

I need to implement this scheme. But I face a warning

S3459: "Unassigned members should be removed".

This is a tutorial code:

private readonly IEngine engine; *S3459*

public void SomeMethod(int params)
{
    this.engine.StartEngine(params);
}

And the scheme. enter image description here

Question: what exactly am I doing wrong?

CodePudding user response:

Your code:

private readonly IEngine engine;

expects an engine to be initialized in the declaration or the constructor, because the field is enter image description here

  • Related