Quantcast
Channel: User Filip Milovanović - Software Engineering Stack Exchange
Browsing all 164 articles
Browse latest View live

Comment by Filip Milovanović on Does the signature of a method create a...

@Steve "this notion of a "contract" is generally an ill-defined thing" - not if you define it well (as in, very precisely, clearly, at the appropriate level of abstraction) and if your team consists of...

View Article


Comment by Filip Milovanović on Invariant rule in Liskov Substitution Principle

P.S. For an ordinary class, it's the constructor of a class that establishes an invariant for a type, and then all other methods need to make sure it is not broken. However, in their paper, Liskov and...

View Article


Comment by Filip Milovanović on In OOP, what counts as a "getter"

There was a time when there wasn't special syntax for getters and setters - there were just methods (and people would write getSomething(), setSomething(val)). The terms "getter" and "setter" originate...

View Article

Comment by Filip Milovanović on How far can you push Object Oriented...

"A getter is a failure to design an object." - I think that the crux of the issue is that this is too general a statement, taken at face value. What many people do with getters is they just expose each...

View Article

Comment by Filip Milovanović on How far can you push Object Oriented...

Not a thing to do with general-purpose data structures, but for the sake of the argument, yeah a getter free design would look something like that (though you could argue this is not exactly a hash...

View Article


Comment by Filip Milovanović on Does changing the default value of a class...

To help clarify a bit what people mean by "adhering to the contract" - it refers to guarantees the type spec makes, that people using it can rely on. Suppose the type in question is a collection of...

View Article

Comment by Filip Milovanović on Are "factory methods" anti-pattern now?

For the record, singletons aren't considered an anti-pattern because DI containers appeared and took over instance management, but because (1) a singleton is a global, and (2) it is often haphazardly...

View Article

Comment by Filip Milovanović on Are "factory methods" anti-pattern now?

@demavi - DI is a design technique - it existed as a concept (and a practice) before DI frameworks were invented. DI frameworks just help manage the lifetimes, and abstract away the actual process of...

View Article


Comment by Filip Milovanović on Should Value Objects be used inside the DTO?

Your question doesn't entirely make sense to me as stated (though I can guess what you're getting at). But for clarity - what have you read, and as a result of this, what do you think value objects...

View Article


Comment by Filip Milovanović on Where does the practice of naming variables...

I'd also say, as the answer below suggests, the "my" prefix comes from practice examples and homework and such. But some people might be using this in a very specific way. In the professional world,...

View Article

Comment by Filip Milovanović on What is vertical coupling? Do we care?

For the record: If you said "vertical coupling" to me without any extra context, I would assume you were talking about coupling of software components across layers (as opposed to "horizontal...

View Article

Comment by Filip Milovanović on What is vertically coupled alignment in...

For the record: If you said "vertical coupling" to me without any extra context, I would assume you were talking about coupling of software components across layers (as opposed to "horizontal...

View Article

Comment by Filip Milovanović on Setting up private properties for unit testing

Private properties are private, unit tests should not access them. Otherwise, you have tight coupling between your classes and the tests, and you can't do refactoring, or really change anything without...

View Article


Comment by Filip Milovanović on (functional programming) What do you call a...

Doc Brown has a point there. On the one hand, yes, this is a kind of a wrapper function, but really, all you do when writing a program is you're calling functions inside other functions, and composing...

View Article

Comment by Filip Milovanović on Help me clarify the cardinality for some...

As an exercise, this seems reasonable for the most part. In principle, many different attacks could exploit the same set of vulnerabilities, so I'd model that as many-to-many (1..* - 1..*). In the real...

View Article


Comment by Filip Milovanović on Dependency injection - passing responsibility...

Structurally, your approach in general makes proper testing easier (each class deals with a specific part of the overall problem, makes fewer assumptions, and each needs just one mock). That said, it's...

View Article

Comment by Filip Milovanović on Dependency injection - passing responsibility...

@JohnyProkie "[Repository and Converter not mentioned] as they were not important for the given question" - perhaps not directly, but, as you presented it, your teammate's "Exporter" is actually a...

View Article


Comment by Filip Milovanović on Seeking Clarification on the Abstract Factory...

The term "family" in technical contexts (like math) typically just means "a set of objects that are somehow related or of the same kind". E.g., f(x) + C is a family of functions that have the same...

View Article

Comment by Filip Milovanović on Is a callback function with `this` as an...

With option 2, you must have an existing instance of Foo that you can lambda-capture. If your class Bar had fields foo and foo1, and you used the wrong one (say, by copy-pasting the code and forgetting...

View Article

Comment by Filip Milovanović on How to design user-defined ordering of items?

Are the users only able to see their own labs, or can the labs be shared? If they are shared, then you cannot associate user-specific ordering with only the Labs table itself. BTW, if the lab list (or...

View Article
Browsing all 164 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>