All Questions
20 questions
8votes
1answer
7kviews
Implementing a REST API in a Clean Architecture
I have been implementing a proof of concept application using Uncle Bob's Clean Architecture and I have run into a bit of a problem. Uncle Bob's architecture calls for the explicit separation of ...
7votes
5answers
3kviews
Design pattern for 2 methods one has 70% arguments of other one
I am trying to do a design for notification part in the system I have 2 parts inApp notification and email notification so I used strategy pattern where I have interface NotificationSender with one ...
7votes
2answers
6kviews
Is the builder pattern appropriate to use to update Objects in a Service layer?
Currently, in our service layer, we pass an id as well as a new updated value, something akin to updatePersonName(Person person, Name name) which, in turn, calls the corresponding repository ...
5votes
4answers
4kviews
What is a good pattern for combined caching and reinitialization?
I have a situation where I have three requirements: Lazy initialization - don't create the collection until asked for it Caching - keep the collection in memory on the object Reinitialization - be ...
4votes
5answers
234views
How can I determine if a field should be separated into its own class?
For example, lets say I have this class: public class Account { private String username private String email private String phoneNumber private String zipCode private String ...
2votes
2answers
2kviews
Problems with OO design for application with pluggable components
I'm trying to refactor an ugly code and make it easly extendable in the future. The application should be nothing else but a series of components that have input(s) and output(s). The components ...
1vote
4answers
234views
Architectural problem for class combination (cartesian product) for save format strategy
Hello to everyone and thank you for any suggestion. I have a family of subclasses of Track (Track is abstract). Every concrete Track has a different number and types of fields (attributes) that extend ...
1vote
1answer
6kviews
Design Pattern for accessing data over RestAPI calls
I am looking out for a general design strategy or pattern designing various components in my client application. Here are high level details: The data is accessed my making a RestAPI call. The data ...
1vote
1answer
841views
Rich Model vs God Class [duplicate]
I have a legacy code containing some behaviour classes, like services and controllers. My model is pretty anaemic. It's just a repository of getters and setters, and I want to refactor it. There is a ...
1vote
1answer
307views
Writing Event Process architecture for multiple event handler interfaces
I am working on Java program which will listen multiple kind of events from multiple sources and store information to multiple sinks. Each interface will have its own source to listen and own sink ...
1vote
1answer
131views
Using constructors for "layered" instances
I'm working on a library that can represent LED strips virtually. My main class, LEDStrip, is abstract and has a couple abstract methods, like getLength() and setColor(int index, Color c). This lets ...
1vote
2answers
122views
Designing UI module for an application
I have an UI module that will expose only one class - UserInterface. The class will be responsible for collecting user input and providing output (command line UI style). From logical way of thinking, ...
1vote
1answer
2kviews
MVP: Should a View have multiple Presenters?
Is it desirable (from an architectural standpoint) to have more than one Presenter communicating with a View? In my particular situation I have one presenter communicating with multiple views, and ...
1vote
1answer
386views
Designing controller for modular Java architecture
We are designing a system which mimics a BPEL application with sets of functional requirements such as bulk messaging, managing SLAs, error handling and so on. One of the intentions is to modularize ...
1vote
1answer
746views
Where and how to connect to external API in my service class?
In my service class I would like to connect to external API. Where and how should I do it? 1) Inject in constructor ExternalClass and assign to private property. Next in other property in constructor ...