Questions tagged [state]
Use the [state] tag for questions pertaining to retained information determining the behavior of a program.
169 questions
1
vote
1
answer
257
views
OO design - Process that relies on the current state of objects
We have a CAD software extension, where you can draw products like walls, doors, windows, etc., and you can export the drawing as an order, which contains the parts and costs.
As part of this export, ...
0
votes
2
answers
377
views
Global State, How To Do IT?
im kind of a newbie so take me easy
i face a problem every time i make a project
specially Client projects, which is Global State i always struggle to do it
for example, here is the structure of one ...
2
votes
3
answers
187
views
Handling user strategy choice over many strategy patterns
I’m building a framework with many parallel implementations of strategy patterns, and I want to know the best way to handle the user’s choice of the set of strategies. E.g.
I want to calculate the ...
4
votes
3
answers
909
views
Clearing static state before testing each method
My SUT class depends on external static state (which generally should be avoided, I know).
How do I make sure my tests do not depend on their order of execution?
I mean other by introducing some reset(...
0
votes
1
answer
594
views
Global Variables State Management
Background:
I am working in a Java environment using Spring Boot, where I often encounter scenarios where global variable state management is critical, especially within singleton services. I have ...
2
votes
7
answers
479
views
Why does "a consistent, understandable interface" differentiates database from global states?
According to some answers of How are globals any different from a database? that explains how database is different from global state:
https://softwareengineering.stackexchange.com/a/319389
https://...
0
votes
1
answer
215
views
Complex stateful logic in MVVM architecture
I'm building a mobile app in Flutter, and the project has several distinct layers. The top part is something better described as MVVM: dumb View layer that performs rendering and delegates actions to ...
0
votes
1
answer
198
views
when would I need state management like redux in my e commerce app?
I am new to React and web development generally so please try to understand if the question seems dumb.
So, I am currently making a simple e-commerce app and I was thinking of using state management ...
13
votes
4
answers
5k
views
Is there a clean way to model methods that only make sense depending on the current state of the object?
Let's say that I have a class called Mission. This class is intended to represent a mission requested by a professor working in a faculty. Mission has a private enum field representing whether the ...
1
vote
5
answers
402
views
Is storing computed values always bad?
Edit: I'm copying the question but changing the example code. Apparently, I used a bad example earlier that contained an imprue getter. I'm keeping the old example code at the bottom so the first ...
1
vote
3
answers
537
views
Why is Dependency Injection called "alternative of global state"?I think global state still exists
According to Why is Global State so Evil?, I believe we should avoid global state, so suppose I have an App that count user clicks in all pages like it:
public class GlobalState{
public int ...
-2
votes
1
answer
263
views
Is it OK to stick with object graph in React State and should I make helpers for handling it?
I am trying to build ERP application using React frontend and I have not found decisive answer whether to use object graphs in React state?
E.g. I would like to build Invoice view and I have the ...
0
votes
1
answer
75
views
Including currect user/roles data within object state in .Net applications to control object behavior
I am building a .Net Core Blazor Server application. The application creates records of a Project class which move through a workflow with various phases of review and acceptance/rejection before ...
-1
votes
1
answer
416
views
When does a REST API stops being one in terms of state management?
As far as I understand, there is no certain boundaries for the RESTness of an API. However, I would like your help to understand how large and long (in terms of running time) a caching or state ...
1
vote
1
answer
261
views
Are there any drawbacks to partial application?
Consider the following Typescript code:
function exampleAction(target: Target, options: ExampleActionOptions) {
// ...
}
export function getExampleAction(options: ExampleActionOptions) {
return (...