Reputation
224
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 9
Newest
 Scholar
Impact
~370 people reached

  • 0 posts edited
  • 0 helpful flags
  • 19 votes cast
Aug
21
comment Strategy pattern and “Is a” relationship
I could not really read your diagram. As much as I understand it is to set another parameter before the call of matchCount and again call? Could you please write a code in C++ or Java or C# to demonstrate your diagram? Thanks!
Aug
21
comment Strategy pattern and “Is a” relationship
It calculates match count based on different criteria. So as criteria changes you need to provide more data so that it could count some items in some storage based on that criteria. Please if you see any good way of doing, please write a sample code. I followed @BartvanIngenSchenau approach and created not connected hierarchy for each family, but I am not sure this was the right thing to do.
Aug
21
comment Strategy pattern and “Is a” relationship
How to inject them, in CTOR? I need to inject them before each call of matchCount. It sounds to me that I need a method called config that injects. But now I will have the same problem with config, right? I should ask how I should polymorphically use conifg if it has different number params?
Aug
21
accepted “Is a” relationship or, in other words Inheritance
Aug
20
comment Strategy pattern and “Is a” relationship
@BenAaronson agree.
Aug
20
comment “Is a” relationship or, in other words Inheritance
So you suggest to have completely different interfaces for different type of "Eaters". I think if you cannot interchange the implementations such as for Man eat(food) cannot make sense, then this means Man cannot be derived from IAnimal, or IEater.
Aug
20
comment Strategy pattern and “Is a” relationship
Sorry, actual problem is so hard to explain. I have tried to abstract with simple examples.
Aug
20
comment Strategy pattern and “Is a” relationship
@BenAaronson please look at my other question: programmers.stackexchange.com/questions/294132/…
Aug
20
comment Strategy pattern and “Is a” relationship
How can overloads work, if I want to use IAlgos interchangeably? Maybe I don't get your point. Could you elaborate more on overloads, please? Optional arguments smell, if we have lots of them but one only several. And messages sound like downcast will be needed.
Aug
20
comment Strategy pattern and “Is a” relationship
Nice question, thanks! Each user uses one family. Users are divided to families. There is a IUser and here are IUserA, IUserB and IUserC.
Aug
20
asked “Is a” relationship or, in other words Inheritance
Aug
20
awarded  Scholar
Aug
20
accepted How to understand if a property is a member of a class or I have to create a different class that holds it?
Aug
20
asked Strategy pattern and “Is a” relationship
Aug
20
awarded  Commentator
Aug
20
comment Modified Strategy Design Pattern
@tallseth I see downcast too. But I don't see better ways. Could you please point out a better solution? An article or something?
Aug
10
comment How to understand if a property is a member of a class or I have to create a different class that holds it?
High cohesion sounds nice. But then I will create tons of managers! :)
Aug
10
comment How to understand if a property is a member of a class or I have to create a different class that holds it?
I don't understand your guidline. Please elaborate more. And what about projecting your guidline on my example?
Aug
10
asked How to understand if a property is a member of a class or I have to create a different class that holds it?
Feb
5
comment What is the necessity to go for lambda functions and expressions in C++?
+1 for "...is not meant to be reused"