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

  • Home
  • SEARCH
  • 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 6554301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:41:01+00:00 2026-05-25T12:41:01+00:00

I’m currently facing a design problem and would appreciate advice on how I could

  • 0

I’m currently facing a design problem and would appreciate advice on how I could resolve it:

The problem

I will use an example to illustrate my problem note this is just an example:

Suppose you have an interface called Pass with methods listed:

public interface Pass {
  public boolean hasPassedA();
      public boolean hasPassedB();
      public boolean hasPassedC();
}

Suppose you have a class which implement this interface called Assessor:

public class Assessor implements Pass{
// how should I implement this class ?? 
}

Finally Student class:

public class Student {
  // some code that defines student behaviour not important.
}

The question is then how can I make the interaction between the Assessor and the student object a lot more flexible?

What I noticed is that an Assessor object should be something that is abstract because in reality there is no such thing as an Assessor, but instead you have different types of assessors such as a Math Assessor or English Assessor etc, which in turn will allow me to create different types of Assessor objects e.g.

MathAssessor extends Assessor
EnglishAssessor extends Assessor

The concept is that a Student can pass if all the methods declared in the Pass interface return true and all additional methods in the subjectAssessor classes return true.

What do I do in the Assessor class? I have read about adapter design patterns but haven’t fully grasped that notion or does it even apply to this situation?

  • 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-25T12:41:01+00:00Added an answer on May 25, 2026 at 12:41 pm

    To start, the Pass interface you have is not very flexible, which could make for difficulties. For example, what if one implementation of Pass only needs to have hasPassedA, or you have an implementation which needs hasPassedA, hasPassedB, hasPassedC and hasPassedD. Then the various types of assessors will need to figure out which pass conditions to check.

    A more flexible way to do this might be to do something like this. Rather than having a Pass interface, maybe something like a Condition interface (the names of the classes/interfaces should be changed to make sense for your domain).

    public interface Condition {
    
       // true means the condition passed, false means it did not
       boolean evalutate();
    }
    

    Now you could have a single Assessor class (I’m not sure if this is exactly how your assessor would work, but it’s just a guideline):

    public class Assessor {
    
       boolean assess(Collection<Condition> conditions) {
          for (Condition c : conditions) {
            if (!c.evaluate()) {
               return false;
            }
          }
          // all conditions passed
          return true;
       }
    }
    

    Hopefully this helps for your problem.

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

Sidebar

Related Questions

I am currently facing a serious problem. I use the standard django admin interface
I'm currently facing a variable substitution related problem in groovy. While this is quite
I am currently designing a public-facing C++ API for a product which will require
I am currently facing a very disturbing problem: interface IStateSpace<Position, Value> where Position :
I am currently facing a problem. How to get the latest selected value from
We currently facing some stability issues with our develop web application product. This product
I'm currently facing huge problem i.e I'm showing Image and some text in a
I'm currently facing a problem where I should store my object structure on the
I'm currently facing a performance problem with creating POCO objects from my database. I'm
I am currently facing a problem that is concerning the google search, curl and

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.