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 7732709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:47:55+00:00 2026-06-01T06:47:55+00:00

I have some business requirements which sound something like this: Find the data in

  • 0

I have some business requirements which sound something like this:

Find the data in the HR Infotypes that meet the criteria (… listed criteria…),

For every found data (record) send e-mail to given recipients with the desired text.

For now I’ve got few sets of criteria to find specific data, but I know that in the future there will be another sets.

I’ve decided to build the solution where every set of criteria and settings for messages would be a single class – a SearchAgent or something:

public abstract AbstractSearchAgent {
    public run(){...}
    public get_results() {...}
    public send_info() {...}
}

first question: is the concept correct?

I also wanted to design application where the main app will be implemented once. when i get the new criteria of searching the data, I only add another child class and the rest will be the same:

public class myApp {
    private AbstractSearchAgent searchagent; 

    public static void main() {  
      //for each existing implementation of abstractSearchAgent
      //get instance into searchagent
      //and execute its methods:
      // e.g. 
        searchagent->run();
        searchagent->send_info();
      //
      // if i wanted to do something else with the result
        result = searchagent->get_results();
}

second question: how to do it? 🙂

I thought of using the abstract factory or builder pattern but I don’t know which pattern will be proper for this situation and how to build it?

Could anyone help me to decide which way is better?

  • 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-06-01T06:47:56+00:00Added an answer on June 1, 2026 at 6:47 am

    Basically this sounds like a Strategy, which is perfectly usable for this kind of job. You are right that you can use a Factory to create the desired search agent.

    To improve long term maintainability of your solution, you may consider implementing your search agents as Composites of basic criteria, thus making individual criteria more reusable. This is best when the search criteria can be complex logical expressions, and especially if these include NOT / OR operators, e.g. “name does not start with ‘M’ and (age is less than 30 or age is greater than 50)”. The implementation of this as a Composite hierarchy could look something like this:

    • AndCriteria
      • NotCriteria
        • NameCriteria
      • OrCriteria
        • AgeCriteria
        • AgeCriteria

    An alternative to this would be Decorator. This is adequate if the search criteria can be performed in a linear fashion, such as “name starts with ‘M’ and age is less than 30 and gender is female”. This could be implemented as a sequence of Decorators like this:

    NameFilter -> AgeFilter -> GenderFilter
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a business requirement that some users be automatically logged out of our
I am creating a series of UserControls that all have some similar business logic.
I have a servlet that does some business login and then redirects to a
I have a library that I created with some business logic that includes writing
I have a service object that is responsible for some business logic validation. What
I have a number of tables containing some basic (business related) mapping data. What's
Let's say you have a business logic method that can perform some operation across
I have some arbitrary pixel data that I want to save as a PNG.
I have some data loaded as a np.ndarray and need to convert it to
We are developing a large applications which are related to business. You can find

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.