Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6116123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:10:13+00:00 2026-05-23T15:10:13+00:00

Scenario I’m building a system where each item gets reviewed by 2 different people.

  • 0

Scenario

I’m building a system where each item gets reviewed by 2 different people. Whenever the first reviewer saves an item review it’s then turn for the second checker to complete their individual review. If I submitted the first review and I open the item again then the item is put into a read only state because you can’t review your own work. Also, the first reviewer can put the item into a pending state if more information is required, which the second review can’t. Each user is given a specific reviewer roll whenever they select an item from a list.

What I have so far

Each time an item is loaded into the editor the person is given one of 2 roles, InitialReviewer or SecondReviewer.

public class Reviewer
{
    public void AddReview(string review) { }
}

public class InitialReviewer : Reviewer, ICanPutIntoPendingState
{
    public void PutIntoPendingState(string pendingState) { }
}

public class SecondReviewer : Reviewer
{
    // Just use base class to add review
}

public class ReviewerService
{
    private readonly Reviewer _reviewer;

    public void AddReview(string review)
    {
        _reviewer.AddReview(review);
    }

    public void PutIntoPendingState(string pendingState)
    {
        _reviewer.PutIntoPendingState(pendingState);
    }
}

A trimmed down version of my editor.

public class Editor
{
    private readonly ReviewerService _reviewerService;

    public Editor(ReviewerService reviewerService)
    {
        _reviewerService = reviewerService;
    }

    public void SaveCommand()
    {
        if(user chose a pending state && _reviewerService.Reviewer is ICanPutIntoPendingState) // Pending state is a dropdown.
            _reviewerService.PutIntoPendingState("pending state");
        else // the user made a complete review
            _reviewerService.AddReview("user review");
    }
}

Problem

The issue I’m having is that I can’t seem to escape from having logic inside Save() from the Editor class that doesn’t belong there.

Question

How do I rid myself of the logic inside of the Save() function from the Editor class? It appears to be violating the SRP principle. Checking whether the current reviewer object is of type ICanPutIntoPendingState is the big problem, I think.

Note that I’ve ommited all logic because there’s quite a bit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:10:14+00:00Added an answer on May 23, 2026 at 3:10 pm

    Woudn’t be enough to give to ReviewerService one Save() method, which internaly call one Save() method of, at this point, abstract class Reviewer, whom abstact Save() method’s concrete implementation is made in InitialReviewer and SecondReviewer. So you push decisional logic to classes with concrete implementation.
    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Scenario: There are multiple C structs, each of which contains a function pointer to
Scenario: First activity starts seconds activity with startActivityForResult Second activity starts third activity with
Scenario: I have several services that I want to be discovered by different clients.
Scenario I have a TreeView that is bound to ObservableCollection<T> . The collection gets
Scenario The system has classes declared in /system/classes/ . The application has classes declared
Scenario: I have a WPF desktop application which will be distributed on different machines
Scenario: I have a MySQL database of people and all their various features as
Scenario: 2 network devices, each on separate private LANs. The LANs are connected by
Scenario: People Picker control on an aspx page. <wssawc:PeopleEditor AllowEmpty=false AcceptAnyEmailAddresses=true ValidateResolvedEntity=true ShowButtons=true ShowDataValidationErrorBorder=true
Scenario: I want to have an enum containing all the playing cards in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.