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

Comment by Filip Milovanović on Repository and Service Interfaces in an...

@SamuelObisesan Thank you for taking the time to improve the answer. I've accepted most of your edits, but I elected to rephrase some parts of the answer for clarity. There was one edit that didn't...

View Article


Comment by Filip Milovanović on Why is a test coverage type called "code...

Seems like the source of the confusion is simply a quirk of the language: "X coverage" doesn't have to imply "coverage (of something) by X", it can also mean "coverage of X (by something)". In either...

View Article


Comment by Filip Milovanović on Code reusability/inheritance introduces...

Declare those internals as separate classes. You can then either inherit them or compose them into your object. Then write tests for those classes once (if you're using inheritance and the base class...

View Article

Comment by Filip Milovanović on Do I need to create an interface for every...

"which I think means I should create an interface for each service" - it does not mean that. The first point to keep in mind is: this shouldn't be done mechanistically - you actually have to think...

View Article

Comment by Filip Milovanović on DDD - When a single physical entity in the...

"My question is ..." - the whole point of BCs is that building it all as one big application would result in a complicated mess. Instead, after your analysis of the way the business operates, you...

View Article


Comment by Filip Milovanović on Is it better to pass a specific “context”...

Generally, it's a good idea to minimize what each chunk of code with a well defined purpose depends on, but you also don't want to pay for that with a high maintenance cost, if you can avoid it. Now,...

View Article

Comment by Filip Milovanović on When DI goes too deep - what is another...

Game developers today mostly prefer an approach called Entity-Component-System (ECS), so look that up. Many will say that this is a completely different paradigm compared to OO, but I'm not convinced,...

View Article

Comment by Filip Milovanović on Should I expose an instance's state with...

"I have this impression over methods because they seems more "closed", differently from a property, which seems to be exposing the state of the instance as if I were going into the instance's bowls and...

View Article


Comment by Filip Milovanović on Why is it that C# can be easily compiled to...

Let me clarify things a bit. So, both C# and Java are normally compiled to a platform independent intermediate language (Java to Bytecode, C# to CIL) that kind of looks like assembly code, and when you...

View Article


Comment by Filip Milovanović on What is a suitable format for writing large...

When you say "total number of variables in the structure is 300", do you mean to say that DataStruct has 300 different fields (as opposed to just a couple of fields that are mostly vectors that...

View Article

Comment by Filip Milovanović on Designing a Robust Modular Hardware-Oriented...

For what it's worth, while this may be too extensive a question for this site, I love that you are thinking about all these design considerations, and I wish this community in particular had a proper...

View Article

Comment by Filip Milovanović on C#'s Aversion to Array

Your final paragraph is not exactly wrong, but isn't quite right either. IEnumerable<T> is an interface that (pretty much) every collection in C# implements, List<T> being a prime example....

View Article

Comment by Filip Milovanović on C#'s Aversion to Array

Prefer IEnumerable<T> for inputs to public methods (more so if they are of wider utility). This gives you more flexibility, as you can theoretically pass in any collection. That is, unless you...

View Article


Comment by Filip Milovanović on What's a good way to use exceptions in a C++...

Can't write a full answer, but let me address some points of confusion. 1) "Best practices" are not literally "best"; they are things that worked well in practice for people who were their original...

View Article

Comment by Filip Milovanović on How to derive software requirements from...

"how to systematically derive" - I may be misinterpreting what you're saying here, but perhaps you are taking the term "derive" too literally? You actually have to create (as in, use your expertise to...

View Article


Comment by Filip Milovanović on Naming factory methods

You might be asking a broader question, but the particular example shown is essentially the Singleton pattern. There, such a method is usually called getInstance() (as it's always the same instance...

View Article

Comment by Filip Milovanović on Naming factory methods

@SergeyZolotarev - JonasH is not suggesting that you use a field, it just seems that way due to his C# background. There, Instance is typically a "property"; these look like fields at the call site,...

View Article


Comment by Filip Milovanović on What are the main advantages of the...

Just to clarify, are you saying that people in your team are currently using dependency injection, but do it because it's a "best practice", without really understanding why - in particular, without an...

View Article
Browsing all 178 articles
Browse latest View live


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