• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Need help with identifying a design pattern(s) in a codebase

 
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Everyone,

I need help with identifying a design pattern in a codebase which I will describe on high level.

This is a service which receives a request with parameters. Among the parameters, the 2 relevant ones are:

1. Sources - a list of data sources from where to obtain the data for the Reports (2nd parameter). Note that among the various attributes the relevant one is the SourceType. Let's use as an example the following list of sources:

- SourceName: Source1, SourceType: SourceTypeA
- SourceName: Source2, SourceType: SourceTypeA
- SourceName: Source3, SourceType: SourceTypeB

2. Reports - a list of reports that we want the service to return. Every report uses certain SourceType(s) to build the report but note that multiple reports may use the same SourceType(s). As an example, let's use a reports:

- ReportName: Report1, SourceType(s) Used: SourceTypeA, SourceTypeB
- ReportName: Report2, SourceType(s) Used: SourceTypeA

I went over the 2 relevant parameters. Now I'll describe the workflow (and some additional structure along the way).

Step 1:

There exist various ReportGenerators whose purpose is to, well, generate the reports. The service asks the appropriate ReportGenerators, based on the Reports, what kind of SourceType(s) do they need and puts this collection into a Set. Thus, in our example, the Set is {SourceTypeA, SourceTypeB}.

Step 2:

It queries DBs and/or other services to obtain the needed data and puts it into a Consolidated Data object. Thus, in our example, the Consolidated Data object will contain data for SourceTypeA (which is comprised of Source1 and Source2) and SourceTypeB (just Source3).

Step 3:

The service passes the Consolidated Data object to ReportGenerator1 (which will use Source1, Source2, and Source3 data which was collected in Step 2) and saves the output report in a Result object. And then it does the same for ReportGenerator2 (which will use only Source1 and Source2 data which was collected in Step 2), and saves this output report in the Result object, as well.

Step 4:

It returns the Result object (which contains the 2 reports, as per our example).

Can somebody please tell me if this is based on some Design Pattern(s)?

Thank you in advance.
 
Sheriff
Posts: 16767
281
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I do not recognize this as any documented pattern that I'm aware of. Also, it seems too complicated and specific to be captured as a pattern. Patterns tend to be more general, hence, you'll see them in many different situations. This particular design seems to be very specific to your situation.
 
Stan Belen
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for looking at it.
 
reply
    Bookmark Topic Watch Topic
  • New Topic