All Questions
9 questions
2
votes
1
answer
289
views
Did the term "decorator" originate with OOP design patterns?
The Decorator pattern allows behaviour to be dynamically added to an existing object, effectively "decorating" it with new behaviour. While the pattern as formalised and named seems to have ...
21
votes
5
answers
25k
views
Is the Entity Component System architecture object oriented by definition?
Is the Entity Component System architecture object oriented, by definition? It seems more procedural or functional to me. My opinion is that it doesn't prevent you from implementing it in an OO ...
1
vote
4
answers
884
views
Design pattern for a function class
I have been experimenting with the idea of function classes as explained in this article and Composition applied to function dependencies as described in the following questions:
https://stackoverflow....
1
vote
5
answers
2k
views
Software design pattern for class method that only should be called once
Say I have a TypeScript class:
export class TypeCreator {
entities: Set<Whatever>
registerEntities(e: Set<Whatever>): Set<Whatever>{
return this.entities = e;
}
}
if ...
2
votes
3
answers
472
views
Swappable state object or decoupling data and functions
I come from OOP pradigm and I also know a bit about functional programming and its advantages. Over time I came to like the separation of data and transformations that are applied to it using pure ...
-1
votes
1
answer
210
views
Refactoring: Pythonic way of reducing the subclasses?
background: so, I am working on an NLP problem. where I need to extract different types of features based on different types of context from text documents. and I currently have a setup where there is ...
1
vote
1
answer
355
views
Is designing a generic parameterized class with methods of it accepting higher order functions a functional technique that we can use in Java 8?
Recently I have asked this question: How do you rewrite the code which using generics and functionals in Java 8 and mixing oop and functional programming by using only object-oriented? on ...
3
votes
7
answers
2k
views
Architectural patterns for interaction beyond MVC? [closed]
We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment.
What are some other architectural ...
2
votes
1
answer
639
views
Should all functions be fully self-contained (is it bad practice to share a variable between functions)?
There are two ways to do the same thing (pseudo code)
Define databaseHandle in the parent function, and use it as a global in this scope:
function API() {
function openDatabase() {
return ...