Questions tagged [inheritance]

Inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both, depending upon programming language support.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
224 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
0answers
61 views

Entity Framework - Old school save/update advice?

I've a query for you relating to best use of EF6 when using Winforms yet not having justification for changing things to something more modern. I've got half a dozen classes that are based on ...
3
votes
0answers
126 views

Can/should objects share methods in certain circumstances?

I am currently working on a web application that is supposed to resemble an operating system with GUI (it manages processes and windows). I have several constructors which deal with different aspects ...
2
votes
1answer
108 views

Is making your ORM DAO a subclass of your Domain Model object a viable strategy?

I am trying to separate my domain model and associated business logic from my persistence model, particularly such that the domain model has no dependency on the ORM. One apparent way to do that was ...
2
votes
1answer
83 views

DDD: Type hierarchy of entities' property

Say I have an Delivery class which should have a Destination property (among many others). Destination can be an Address (country, city, address line, post code) or a Port (international code, name). ...
1
vote
0answers
1k views

Python inheritance/import - parent file imported modules, should child import too or thru parent?

My apology if this question is already answered & accessible through search - not quite sure how to phrase this particular query. So, here's scenario & question: File a.py imports several ...
1
vote
0answers
398 views

Conceptual similarity between Ruby's and JavaScript's inheritance models

To clear some potential confusion, let me start with the following statements As far as I understand, inheritance is mostly about dynamic dispatch. I understand how virtual pointer table based ...
1
vote
0answers
92 views

If the externally callable interface of a class is called its API, what is “what can be overridden” called?

It's about what the class gives access to through inheritance. It has a three letter abbreviation but not API. I've seen this before but can't remember at the moment. The term is usually used in ...
1
vote
0answers
598 views

Class Interfaces with Multiple Classes and Dependency Injection

NOTE ON QUESTION TITLE: I did not really even know how to phrase the title so if someone can edit and make it more articulate I would really appreciate it. QUESTION: Basically, what I'm trying to do ...
1
vote
0answers
477 views

Reusable and customizable charting library on top of d3js

I have started building a charting library on top of d3js using javascript's inheritance. My goal is to develop reusable and fully customizable chart components. I read the article: Towards Reusable ...
1
vote
0answers
114 views

Inheritance and constricted referencing

Let's say I have BaseA and BaseB classes. BaseB can have to several references of BaseA instances. Now, we have two other classes, DerivedA and DerivedB that respectively inherit from BaseA and BaseB. ...
0
votes
0answers
37 views

How to store metadata (e.g. table name) for a model class?

What is the proper way to get a metadata of the type in languages that doesn't allow static methods/functions to be overridden? For example, I'm using Dart: abstract class Model { // Constructor ...
0
votes
1answer
146 views

Parameters vs Specialized functions

Trying to figure out which structure is cleaner between using a specialized function or using parameters to accomplish the same thing (see code example below). Essentially, I can reduce the number of ...
0
votes
0answers
26 views

How to organize classes which should reflect different versions of standard?

I have some standard which changes in time. Let's say I have std_v1, std_v2 and std_v3. Those standards have a lot of common parts with some little differences, possible additions and deletions. On ...
0
votes
0answers
120 views

Example of persisting an inheritance relationship using ORM

I have some experience with OOP and RDBs, but very little exposure to web programming. I am trying to understand what non-trivial types of problems are solved by ORM. Of course, I am familiar with the ...
-1
votes
4answers
128 views

Base global system for two customizable subcomponents

The following explanation is rather detailed, but I think if I simplified the problem at hand no proper answer could be given. I'm working on a scripting system for a game (for end users rather than ...