Questions tagged [object-oriented]

Questions about the principles of the object-oriented programming paradigm.

Filter by
Sorted by
Tagged with
0
votes
2answers
44 views

Are objects appropriate for modeling the real world?

First of all, I know objects are not meant to model the real world, although they have been marketed as such and perhaps that was an intention at some point. Here I say 'modeling the real world' in a ...
0
votes
0answers
20 views

Object algebras without anonymous inner classes

In de Oliveira and Cook's Extensibility for the Masses uses Java for its code (it's not about stuff specific to that language though) and the ability to create anonymous inner classes is used ...
0
votes
0answers
24 views

Is there an appropriate design pattern for this problem?

In terms of good OOP design, what is the best way to structure the code described below. The data I have a set of commands. Each command has an identifier, deadline, and a set of jobs to be done. Each ...
0
votes
2answers
77 views

What subfields in computer sciences may one study without learning Object Oriented Programming?

What subfields in computer sciences may one study without learning Object Oriented Programming or is there some kind of degree in Computer Science without the OOP knowledge requirement? Is there a ...
1
vote
1answer
12 views

Method provided by component may need to be implemented, What does this mean?

I can't wrap my head around this statement: One common drawback of using composition instead of inheritance is that methods being provided by individual components may have to be implemented in the ...
2
votes
0answers
33 views

Is this possible: In OOP, private methods in a class form a F-coalgebra and public methods in a class form an F-algebra?

I recently found out that OOP classes turn out to be F-coalgebras: https://www.semanticscholar.org/paper/Objects-and-Classes%2C-Co-Algebraically-Jacobs/c7c45abf7d99e0aef627fd5223023bf82e70dc71 The ...
53
votes
1answer
11k views

What is the earliest use of the “this” keyword in any programming language?

I understand the this (or self or Me) is used to refer to the current object, and that it is ...
0
votes
0answers
26 views

data structures/ Classes for RNA & DNA

In bioinformatics they study biological data. I have seen codes dealing with DNA sequences. However, they are treated as string literal. I was wondering if there were data structures or classes in OOP ...
0
votes
1answer
66 views

Usage of stacks and heaps in object-oriented programming. Reasons?

In object oriented programming heaps are used for to store the actual objects. Stacks are used for storing reference-variables to the objects. What's the concrete reasons for choosing those two ...
0
votes
1answer
29 views

What does valid method overriding mean?

In Types and Programming Languages by Pierce, from p257 to p258, about featherweight Java, The predicate override(m, D, C→C0) judges whether a method ...
1
vote
2answers
66 views

Which is a type of objects in mainstream OO languages: a class, an interface, an abstract class, a metaclass?

In Types and Programming Languages by Pierce, Section 18.6 Simple Classes in Chapter 18 Imperative Objects says: We should emphasize that these classes are values, not types. Also we can, if we ...
2
votes
1answer
62 views

In what sense if any does java have multiple dispatch?

I'm trying to get my head around the difference between message passing (with which we are all familiar as by far the most common form of object orientation today) vs generic functions as implemented ...
4
votes
0answers
76 views

Scopes vs objects — would a language make sense that voids the difference?

So there's this adage that says "Objects are a poor man's closures", which can equally well be reversed, which I understand to mean that they are equivalently expressive. What strikes me about the ...
0
votes
1answer
38 views

Does the concept of subtype require dynamic method binding?

https://en.wikipedia.org/wiki/Subtyping says In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which a subtype is a ...
0
votes
1answer
162 views

Why there aren't any famous programming languages that implement what Alan Kay considers to be “real OOP”? [closed]

Why there aren't any famous programming languages that implement what Alan Kay considers to be "real OOP"? Is it because the "modern OOP" that exists in programming languages like C++ and C# and Java ...
0
votes
0answers
290 views

Four Pillars of Object Oriented Programming

I'm researching object oriented programming and I've come across the term "four pillars of OOP" in a few places now. I originally saw them listed as: Abstraction Encapsulation Inheritance ...
2
votes
0answers
32 views

Describing C3 in terms of predicates on types

What is the right way to describe the properties for a method resolution order that naturally lead you to the C3 linearization algorithm? I'm trying to nail down desiderata for an MRO that are ...
1
vote
1answer
92 views

Curry-howard isomorphism in object oriented programming languages

I want to get a better intuition for the curry howard isomorphism, and my intuition is mainly based on object oriented programming languages like JavaScript. So as an example, I am going to formalize ...
-2
votes
2answers
38 views

How to specify a robot go always right relative to itself from absolute perspective (north west east south)

I have a robot that has a start and goal position within a maze. Each point in the maze-grid is simply a Position object containing x and y. I need an algorithm that specifies the robot only moving to ...
2
votes
1answer
117 views

How to implement polymorphism in a turing complete environment?

I'm currently programming in an unnamed turing complete language which has support for pointers, primitive data types, structures, closures, and garbage collection, among other things. I'm trying to ...
1
vote
1answer
225 views

Auto-generating a class hierarchy/inheritance tree from a data set of objects with properties

What is an algorithm that will take as an input a flat list of objects with a varying degree of overlapping properties: ...
8
votes
1answer
1k views

What is the origin of dot notation?

In object-oriented programming, dot notation is used when accessing the properties or methods of a class: ...
4
votes
0answers
24 views

N-Dimensional method lookup: sender vs context

So, there is an idea about multi-dimensional behaviour selectors that goes like follows (based on paper by R.Hirschfeld and P.Costanza : "Context oriented programming"): "selector": in 1D lookup we ...
0
votes
2answers
1k views

Is the implementation relation between an interface and a class an instantiation or inheritance relation, or neither?

In Python, we have metaclass and abstract class. In Java and C#, we have interface and <...
3
votes
1answer
424 views

Is it possible to implement dependent types by any object oriented language supporting inheritance and classes?

When I was reading Agda tutorial, I noticed resemblance between dependent type declarations and class definitions which I've been primarily used to work with. I'm not totally sure how much sense this ...
2
votes
1answer
135 views

What's the difference between subtyping and inheritance?

In object-oriented programming, I have learned the concept of subtyping and inheritance. I thought they're the same thing, in ...
2
votes
1answer
60 views

Are synchronous message sends a subset of async. ones?

Imagine any object oriented PL based around the idea of message sends: some method basically performs something like this: ...
1
vote
1answer
37 views

Was multiple inheritance ever implemented by adding redundant data members?

In discussions about why most languages which implement inheritance only implement single-inheritance, the question of the precise semantics of overlaps often comes up, and having redundant data ...
1
vote
0answers
53 views

Explain static and dynamic binding without Overloading and Overriding?

few days ago I attended a interview, and the interviewer asked me a very common but strange question. Explain static and dynamic binding without using method overloading and method overriding ? I ...
7
votes
1answer
1k views

The C3 linearization algorithm for method resolution in multiple inheritance OO languages: Looking for a justification for some implementation detail

According to this description of Python's method resolution order (mro), a.k.a. C3 linearization, the algorithm can be described recursively as follows: ...
1
vote
2answers
93 views

Are grandparent classes also parents?

Let's say I have three classes, Animal, Bird and Pigeon. If ...
5
votes
2answers
537 views

What would “sum types with functions” look like in OOP?

It's fair to summarize classes in OOP as "product types with functions." However, couldn't there be something like "sum types with functions"? How would inheritance work with them? I'm trying to ...
1
vote
0answers
72 views

Principle of locality for object-key data pairs

It seems that if we only have object-key cache then we won't have spatial locality and only temporal locality. I use memcached in a python application and that has only object-key pairs and no ...
1
vote
0answers
44 views

is-child-of, is-instance-of as intensional and extensional inheritance relation - is object-oriented modelling an great oversimplification?

I am trying to build knowledge base in OpenCog cognitive architecture (http://wiki.opencog.org/w/The_Open_Cognition_Project) and I see that OpenCog lacks usual means to express notions of object-...
2
votes
1answer
20 views

how does an object find the reference to its instance variables

I'm trying to understand how instance variables for a given object are stored for easy access later on. For some background, I understand that if you have a reference to an array it is very easy for ...
0
votes
1answer
40 views

Term for members of a class that are not inherited

Is there an explicit term for a member of a class that is not inherited from any parent class? ...
11
votes
3answers
1k views

Automatic Downcasting by Inferring the Type

In java, you must explicitly cast in order to downcast a variable ...
2
votes
0answers
55 views

An alternative to the object paradigm

I've been playing around with an alternative to the standard object-oriented paradigm for modeling data, and I would like to know if there is any research or already existing systems along the same ...
1
vote
1answer
137 views

Trying to Explain Objects

After a year hiatus from Computer Science courses in college, im back to hitting them hard for the next two years straight. In the next few weeks before classes start again I have been trying to ...
-1
votes
1answer
927 views

Stereotype in UML

What is a Stereotype in Unified modelling language?And What are the primary class stereotypes?.I need clear explanation using diagrams or real world scenario.
3
votes
3answers
1k views

“In object-oriented programming, the program is organized around its data”

In a description of OOP in my textbook, it is written that “in procedure oriented program the program is organized around its code while in object oriented programming, the program is organized around ...
2
votes
2answers
2k views

Identity of object in OOP

In the object oriented programming concepts I found the term "Identity of object". What does it mean by "Identity of object"?
10
votes
0answers
126 views

Denotational semantics of object-oriented languages

I am interested in denotational semantics of object oriented languages. Namely, what are the common/typical denotations of objects used in the literature? Is this an interesting topic these days? The ...
6
votes
1answer
244 views

Which object-oriented programming language is the closest to the untyped sigma-calculus?

I'm wondering which of the dynamic object-oriented (or prototype-oriented) languages (like JavaScript, Ruby, Python, etc.) can be considered as the closest to Abadi and Cardelli's untyped sigma ...
-1
votes
1answer
997 views

What is the difference between the friend class and inheritance consept in C++? [closed]

In C++ ,friend class allows us to inherit the proprieties of one class to another class(es) which is also possible using inheritance. And also in inheritance we can set different levels of privileges ...
6
votes
2answers
213 views

What does Harper mean by “class”?

I've been teaching myself type theory on and off over the past couple years. I've reach large sections of Pierce's Types and Programming Languages and Harper's Practical Foundations for Programming ...
11
votes
3answers
5k views

What is the difference between Abstract Data Types and objects?

An answer on Programmers.SE characterizes an essay by Cook (Objects are not ADTs) as saying Objects behave like a characteristic function over the values of a type, rather than as an algebra. ...
0
votes
0answers
40 views

Can any object be written as a graph? [duplicate]

Lately graph theory has come into everyday practice with graph databases. So I wonder if any object can be written as a graph? I don't have the formal definition of an object, but say it is a C ...
3
votes
1answer
4k views

Creating arrays of object of abstract class in statically-typed object-oriented languages

In statically-typed object-oriented languages (like Java, C++, C#, ...), suppose I declare an abstract class: public abstract class myclass1 { ................. } ...
1
vote
0answers
57 views

Variable argument placement in methods

Imagine that we have a base class number that has implemented a integer and floats, but not complex numbers and that we would like to extend it to also support ...