this post was submitted on 30 May 2024
16 points (100.0% liked)
Experienced Devs
3961 readers
5 users here now
A community for discussion amongst professional software developers.
Posts should be relevant to those well into their careers.
For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:
- Logo base by Delapouite under CC BY 3.0 with modifications to add a gradient
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would call them “agents” at a class layer and encapsulate the logic specific to each domain in its own class. Completely arbitrary but in my mind: adapters - call other web services
dao - database calls
agent - responsible for stitching the pieces all together and doing the actual business logic.
Example: OpenWeatherAdapter - call the OpenWeather API. No business logic. H2SelectDao - get user preferences from an internal database. No business logic.
WeatherAgent(openWeatherAdapter, h2SelectDao) - All the business logic.
Note: this is in context of a API service like a middleware.