The Stack Overflow podcast is back! Listen to an interview with our new CEO.

All Questions

Filter by
Sorted by
Tagged with
3
votes
0answers
222 views

Understanding Typescript's views on inheritance

I have been struggling to understand the reasons why typescript developers choose the way they implemented inheritance. What I would expect from any language supporting inheritance is these order of ...
3
votes
2answers
2k views

Is coupling a good thing or bad thing when I'm developing standalone modules in a framework?

Encapsulation is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit. Client code is expected to inherit from system-supplied classes and then ...
2
votes
3answers
190 views

Data duplication, can it be an unavoidable practice in this example?

Say I have different employees of type Employee stored in a list inside a class SubCase. public class SubCase{ protected ArrayList<Employee> employees; ... } SubCase represents a part ...
2
votes
2answers
41 views

Refactor using CTI or create new Entities

I'm currently developing on a rather large e-commerce application that handles multiple different business-fields. Like every e-commerce application we have a Concept called an Order which has one or ...
35
votes
5answers
7k views

When should I extend a Java Swing class?

My current understanding of Inheritance implementation is that one should only extend a class if an IS-A relation is present. If the parent class can further have more specific child types with ...
4
votes
1answer
2k views

The Better Parts and Delegation: Is Crockford Too Extreme?

Douglas Crockford has recently been giving a talk called The Better Parts. The gist of the talk is that JavaScript developers should actually avoid a superset of the The Bad Parts, which now includes ...
37
votes
9answers
9k views

Is creating subclasses for specific instances a bad practice?

Consider the following design public class Person { public virtual string Name { get; } public Person (string name) { this.Name = name; } } public class Karl : Person { ...
0
votes
1answer
177 views

When is it suitable to use inheritance [duplicate]

I recently had a small "argument" about inheritance with a friend. I think people overuse it a lot. Intuition tells me that that the only good reason for class inheritance is polymorphism - when there ...
3
votes
7answers
1k views

OO Software Architecture - base class that everything inherits from. Bad/good idea?

I am reviewing a proposed OO software architecture that looks like this: Base Foo Something Bar SomethingElse Where Base is a static class. My immediate thought was that every object in any ...