5
votes
Accepted
Streams and clean architecture
As a C# guy, at a first glance, I tended to agreed to @GregBurghardt's answer. Then I had a look into the documentation of streams in Dart, which says:
A stream is a sequence of asynchronous events. ...
3
votes
Accepted
Why does the collection library for Dart use a bit mask for hashing collections?
It's hard to know the exact reason for this. That it truncates the hash to fit into 31 bits suggests that it's related to compatibility with 32-bit signed integers. It's also true that the algorithm ...
3
votes
Streams and clean architecture
I associate streams with infrastructure-related code. As such, I would not expect a use case to return a stream.
That being said, if the stream object is an interface or abstract class, you achieve ...
3
votes
Accepted
Is using an UId to hash Mutable Entities an anti-pattern?
There is no anti-pattern here. What you are observing is that when creating domain models, there are different ways how to model the concept of "identity" or "equality".
Value ...
2
votes
Accepted
Where to place a common database connection in clean architecture?
I am currently trying to follow the clean architecture approach but i wonder where common things like a database connections should take place.
Right here:
Since i think a database connection usually ...
2
votes
Best way to display errors from a model to the user?
There is a fundamental decision here that has locked you into this design. Your model is always available and known to everything. This has forced you to make your model mutable.
Instead, you could ...
2
votes
Why does the collection library for Dart use a bit mask for hashing collections?
It seems to be designed in a way where hashing resulting in 32 bit signed integers works. You get collisions, but only one in 2^31 hashes clash. That is enough so you need to have code to handle it, ...
1
vote
Why does the collection library for Dart use a bit mask for hashing collections?
I can only guess, but here's what I think.
First of all you would limit hashes to 32 bits. That's the size of hash that Java (and many other languages) expects. Now hash values are typically used in ...
1
vote
How do I model this scenario so that it adheres to OOP principles?
I can create a factory that maps all slide types to their respective subclass but that would require me modifying the factory for each subclass I add. Does that follow OOP principles?
Such a factory ...
1
vote
How do I model this scenario so that it adheres to OOP principles?
Having a factory method as the one-and-only place in the code that
maps all slide types to their respective subclass
is fine. It is a common approach in OO programming and often sufficient when the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
dart × 18javascript × 6
design-patterns × 2
object-oriented × 2
programming-languages × 2
clean-architecture × 2
flutter × 2
java × 1
c# × 1
web-development × 1
licensing × 1
web-applications × 1
inheritance × 1
gpl × 1
language-design × 1
error-handling × 1
parsing × 1
use-case × 1
anti-patterns × 1
html5 × 1
state × 1
hashing × 1
modules × 1
typescript × 1
error-messages × 1