New answers tagged

0 votes

How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type

You can try writing a plain old function that does 95% of the work, identical for all three classes. And then each class gets a tiny instance method that mostly calls the plain old function. You could ...
gnasher729's user avatar
  • 44.7k
1 vote

How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type

I would implement it using generics similar to java.util.List<E> which has a method E get(int index) where <E> is the different returntype. Taking the minimal example code from Sebastan-s ...
k3b's user avatar
  • 7,518
2 votes

How to eliminate repetition in three subclasses: each defines an identical method that does almost the same thing, but with a different return type

As I see it, you have two possible solutions for this. Generics and the Visitor pattern. Personally, I would go with the second approach as I find it cleaner and more maintainable. In the first ...
Sebastian Sotto M.'s user avatar
9 votes

Is trunk-based development viable for SDK development?

Yes. In fact, the branch for release strategy is specifically designed for this case. For as long as your application, library, framework, SDK, package, etc. needs to be supported, you have a long-...
Thomas Owens's user avatar
  • 82.4k
4 votes

Is trunk-based development viable for SDK development?

In theory there is no difference, all changes are fully tested and signed off before release in any model. However, as I have written about previously, I do think there is a difference in philosophy ...
Ewan's user avatar
  • 74.6k

Top 50 recent answers are included