null
  • Member for 1 year, 4 months
  • Last seen more than 1 year ago
design pattern for ensuring that a container object has at most one instance of an editor
3 votes

You could consider the process of updating the spreadsheet similar to a database transaction. ADO.NET and DataSet/DataRow used to have the concept of BeginEdit(), AcceptChanges(), and EndEdit(). ...

View answer
Is there a name for the code smell where we add different types of objects to a list or array instead of defining a new data structure?
3 votes

It might not be a code smell but it might lead to code smells. If we think of an array as construct that groups items together, books[] or movies[] being simple examples, then is there anything common ...

View answer
Benefits of Dynamic Mocks over Static Mocks?
Accepted answer
2 votes

What you have here is a stub. Stubs are used to inject values into other objects. These values can be used to take the execution down different logical paths in the function under test. Return true, ...

View answer
What is it called when you assign a new instance to another class property?
2 votes

Here is an article that expands on the law of Demeter. https://www2.ccs.neu.edu/research/demeter/demeter-method/LawOfDemeter/paper-boy/demeter.pdf The articles uses the example of a paperboy asking ...

View answer
When to have ID of instance as an instance field vs. decoupled?
2 votes

An ID can be used to indicate two things. It can be used to uniquely identify an object (primary). It can be used to identify a relation between two objects (foreign). (could be a relation between an ...

View answer
Approaches for comment duplication
2 votes

Would it make sense to reference the one comment from the other files. "For addition information on this bug fix see My.Project.Namespace.Class" Or if the namespace and class names may ...

View answer
How to implement time triggered batch processing in a K8s/Java Spring Boot environment?
2 votes

The architecture all pivots on the extraction of the data. Extracting and splitting the data in one micro-service that then spawns worker threads will only scale vertically. Not the best if you have a ...

View answer
Perfect product vs progressive releases
1 votes

Going to expand on the comment about the Lean Startup. As others have stated every successful piece of technology will have been iterated and improved on; it's quite a good indicator of success. If ...

View answer
How to implement a chain of events on a tree's CRUD operations?
1 votes

It might be worth separating the tree out into it's data and the behaviors that are performed on that data. With the behavior separated it will be possible to delete parent, siblings and child nodes ...

View answer
Subscribing to events in factory -- better place?
1 votes

The factory pattern would be useful if the Blackjack object could be build different ways. That doesn't seem the case here. You are concerned about the amount of event handlers that need to be mapped ...

View answer
Best way to scale a service that fetches data and has a REST API to query it
1 votes

The initial problem you have identified is the retrieval of all the data by each service. You are trying to solve that problem. However, have you thought of removing that problem or identifying the ...

View answer
Why does today's companies follow old RFC's?
0 votes

This can be framed under the heading legacy. There is a concept called path dependency where decisions that are made in the past limit the decisions that can be made in the future. In other words, it'...

View answer
How to design a wrapper for a large, multi-response API?
0 votes

Would GraphQL be a way forward? https://graphql.org/

View answer
Using a different algorithm depending on the size of the input
0 votes

It depends on the situation. Take this example, streaming video. When there is ample bandwidth and CPU available then higher quality video can be encoded. When there is less resources then less ...

View answer
Refactor unit tests?
0 votes

You might want to begin with refactoring the tests. The tests capture what the legacy application does; a kind of documentation. Tests tell you input and output, code tells you process. If the tests ...

View answer
How to not violate the single responsibility principle?
-3 votes

The two functions updateWindow and updateTrend should be implemented in classes that implement an interface (lets say an IUpdatable interface). IUpdatable Update(...) StockTrackerWindow : ...

View answer