Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [object-oriented]

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

0
votes
0answers
11 views

What is the name for “referenced” datatypes vs non-referenced datatypes? [on hold]

In Javascript const a = {red: "red"} const b = a; then the object b is not different than a. It is literally just a reference to a. Objects/Arrays follow the ...
0
votes
0answers
24 views

Object-oriented small-step semantics NOT based on rewriting techniques

I am looking for a formalized (imperative and possibly statement based) small-step semantics of a subset of an object oriented programming language that it is not based on rewriting techniques. (e.g., ...
1
vote
1answer
43 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
37 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
89 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
69 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: ...
6
votes
1answer
455 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
20 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
189 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 <...
2
votes
1answer
155 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
38 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
45 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
33 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
45 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 ...
6
votes
1answer
624 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
73 views

Are grandparent classes also parents?

Let's say I have three classes, Animal, Bird and Pigeon. If ...
4
votes
2answers
459 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
59 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
43 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-...
3
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
39 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
933 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
92 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
596 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.
4
votes
3answers
748 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 ...
3
votes
2answers
943 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"?
9
votes
0answers
105 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
202 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
573 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
175 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 ...
10
votes
3answers
3k 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
39 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
2k 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
54 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 ...
4
votes
2answers
191 views

What's the difference between declarative syntax and encapsulation?

I had been first introduced to the idea of declarative syntax when using Angular JS. From what I understand, the idea is that you say, "do this" instead of "in order to do this, do this, this and this"...
6
votes
2answers
112 views

Are class methods closures?

In the wiki article about closures one can read: closure ... is a function or reference to a function together with a referencing environment At the same time in the wiki article about class ...
1
vote
1answer
1k views

Combine abstract factory with decorator pattern [closed]

I'm working on a simple project of software engineering that should combine two patterns. I choose Abstract Factory and Decorator patterns to modify (dynamically) objects created with the concrete ...
9
votes
2answers
1k views

Is there an equivalent of lambda calculus for object oriented languages? [duplicate]

Lambda calculus serves as a foundation for all sorts of functional languages and its various extensions are compiler targets for languages like Haskell, ML, etc. So what is the equivalent for object ...
2
votes
0answers
54 views

Translating object oriented programs to their procedural equivalents

I'm new to the field of program transformation. I'm looking for resources on the techniques and methods one would use to translate object oriented code to its procedural equivalent. In particular, I ...
3
votes
0answers
44 views

Is object oriented programming fundamentally different than imperative programming? [duplicate]

I have been using C for a while, for some reasons I learnt C++. I can't see why object oriented is a "new" feature. For me an object is just a structure, and a set of functions which have a pointer ...
16
votes
8answers
19k views

What problems of procedural programming does OOP solve in practice?

I have studied the book "C++ Demystified". Now I have started to read "Object-Oriented Programming in Turbo C++ first edition (1st edition)" by Robert Lafore. I do not have any knowledge of ...
1
vote
1answer
111 views

How are programming paradigms classified? [closed]

When I started to learn about imperative programming and declarative programming it raised many doubts, like, how are structured, modular and object-oriented programming classified: declarative or ...
4
votes
2answers
70 views

Classes and Algebras: Which begat which?

Way back in the day I took a course on discrete structures and learned about how the mathematical notion of an algebra is akin to the class data type. But I didn't know enough at the time to ask ...
12
votes
2answers
1k views

Is there a theory/abstraction behind OOP?

Functional programming has the very elegant Lambda Calculus and its variants as a backup theory. Is there such a thing for OOP? What is an abstraction for the object oriented model?
3
votes
0answers
55 views

Code measurements in emperical software engineering: how to plan measurements?

I am talking about a measurement plan for software metrics and I am looking for references. In emperical software engineering there are code level measurements ("software metrics" that measure, e.g., ...
3
votes
1answer
168 views

OOP: exampe and references on constructor anomalies

I have read the following artice that defines the term "constructor anomaly": Cohen, Tal, and Joseph Gil. "Better Construction with Factories." journal of object technology 6.6 (2007): 103-123. http:/...
3
votes
3answers
235 views

“OOD allows ADTs to be created and used.”

I just had a CS mid-term and one of the questions was: OOD allows ADTs to be created and used. True False I answered false, but my answer was marked as incorrect. I suspect what the ...
4
votes
1answer
353 views

Contracts for Java Bytecode

Introduction For a paper I need contracts, which are also referred to as Design by Contract (DbC)1, and conceptually go back to Hoare[2]. For my work I need to apply contracts to Java bytecode. The ...
3
votes
1answer
1k views

How to represent OOP concepts in algorithms in a standard way?

I have usually been using the Cormen algorithm format to teach some introductory courses in Programming. I mean something like this: ...