A methodology that enables a system to be modeled as a set of objects that can be controlled and manipulated in a modular manner

learn more… | top users | synonyms (3)

4
votes
2answers
152 views

Where did the three tenets of OOP originate

It is easy to find the origin of the term OOP coined by Alan Kay when he created Smalltalk, but I can't find if when creating the language he also created the 3 tenets of OOP (Encapsulation, ...
4
votes
2answers
317 views

What are the valid uses of static classes?

I noticed that nearly every time I see programmers using static classes in object oriented languages such as C#, they are doing it wrong. The major problems are obviously the global state and the ...
3
votes
4answers
241 views

What programming mindset to have towards JavaScript? [duplicate]

I used to program in Java. As a result of that I got well-versed with Object Oriented Paradigm. In my opinion it is a great approach to programming because it's easy to unit test, use design patterns, ...
0
votes
1answer
74 views

On planning and implementing classes and their properties [on hold]

When writing applications in an object oriented manner, I often have hard times deciding how to implement my classes. I fail to decide which properties should belong to a certain class and often end ...
7
votes
3answers
171 views

How to model and store an entity which has “one or more” values

I'll use C# to design the model to be persisted Let's suppose I have the following entity: public class Episode { public int Id { get; set; } public string Title { get; set; } public ...
0
votes
1answer
53 views

Non-anemic model and SRP

I'm implementing a feature in legacy system right now. Instead of putting all my logic in some dummy application services and having anemic models, I thought I will try to do some OOP this time. I'm ...
0
votes
0answers
72 views

Dealing with several custom getters

I have a data structure with data units containing different types of data. I've wrapped the data in "Field" objects so that each field is able to independently parse user input in a desired way. ...
8
votes
2answers
222 views

Best practices for serialization of DDD aggregates

According to DDD domain logic should not be polluted with technical concerns like serialization, object-relational mapping, etc. So how do you serialize or map the aggregates' state without publicly ...
-2
votes
0answers
33 views

advantages and disadvantages of Dresden OCL Toolkit and Eclipse MDT/OCL [closed]

What are features provided by these two OCL tools? Overall difficulty of use: How easy or hard is the tool to use (understandability, learnability, operability)? Cost: How expensive (e.g. ...
3
votes
3answers
164 views

Is it misleading to label code as a particular design pattern if it only loosely fits the definition?

Background: I have a rough, but working understanding of ~15 design patterns. It's been my experience using design patterns in my own projects that the resulting implementations usually end up as some ...
0
votes
0answers
29 views

Adding new Interface & Replacing Method with Interface Type

Let's say that I have 2 classes: Foo and Bar. `Foo` { List<Bar> bars String bippy() int boop() } `Bar` { int biz() String baz() } Observe that Foo's fields include a List<Bar>. ...
-2
votes
2answers
131 views

Why public access level method get overridden in java?

This question is raised with a clarification required to decide when to declare a method protected or public during class design of a package. My point is, if one needs to override a method of a ...
0
votes
2answers
80 views

Is it ok to access private members while doing same class comparison?

I am writing a class which basically is a wrapper around a dictionary with some extra functionality. This dictionary is stored as protected member _store. Now I am writing a __eq__ method to compare ...
4
votes
3answers
230 views

Why use arg type `class Object` instead of `Comparable[]`?

In the code below, I believe it would look more appropriate to make the method argument be of type Comparable[] instead of Object[]. The first reason it would be more appropriate is that one can be ...
1
vote
1answer
138 views

Modern OOP vs Alan Kays OOP [closed]

I've recently come to discover there's actually a strong amount of criticism towards what people refer to as "modern OOP" - often comparing it to either functional programming or Alan Kays' OOP. ...
2
votes
1answer
209 views

C# OOP Class Usage [duplicate]

I am just being picky and really wanted some of my code to look, feel, and be used a specific way but am not sure if its possible. I have a class I created that can be used like this ...
5
votes
2answers
158 views

How to avoid “type dispatchers” when working with SOLID

I've realized that since I've been more and more strict about the SOLID principles, my code tends to consist of more pure data objects and a lot of "operator" classes which seems to go against ...
22
votes
5answers
1k views

Saving an object via a method of its own or via another class?

If I want to save and retrieve an object. Should I create another class to handle it, or it's better to do that within the class? Or maybe mixing of both? Which is recommended according to OOD ...
4
votes
0answers
527 views

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

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
3answers
372 views

Class design - should methods call other methods?

I'm writing a very basic custom class for coupons and I've come up with a basic layout for the class, which consists of a number of small methods as I generally understand is a best practice. What ...
0
votes
1answer
43 views

How to organize conversion logic for strategy pattern?

I have a Color class. It has a property model which is a class that implements ColorModel interface, this property could be a RGB, Hex or HSL classes which implementing ColorModel interface. // ...
6
votes
1answer
163 views

In MVC should a model contain subview models?

Some background: A colleague and myself have different interpretations of MVC which means, given the same problem, we are coming up with radically different solutions. He comes from a Java background ...
2
votes
3answers
173 views

Getters and Setters unclear example

I know autmatic getters and setters are considers bad as they tend to break object's encapsulation. They also move the work that should have been done within the object outside. Allen Holub is a big ...
1
vote
1answer
124 views

Creating a calendar/planner program. Confused about OO logic?

I'd like to create a piece of software that has the functionality of a common written planner. To do this, it will have a Calendar. When planning the program, I became confused as to how I would ...
1
vote
1answer
171 views

Alan Kay: “The Big Idea is Messaging” [duplicate]

Alan Kay said "OO" was about messaging, not objects and drew a parallel to biological cells. His views are enticing, but vague. The way I understand it is something like a Cellular Automata. In a ...
0
votes
3answers
168 views

Building a calculator using MVC

I've been programming in Java for about 6 months, and I thought a good and challenging test of my skills would be to build a GUI calculator. I have very recently heard about this MVC idea, and I ...
3
votes
0answers
119 views

How to handle a memory consuming member variable

Suppose multiple objects of the same class should do something which takes a memory consuming resource. Which of the following approaches is recommended to define and use the resource by the objects? ...
1
vote
0answers
53 views

Extend, wrap, or both to add generics to a class that should have had them?

So I'm using a C# framework that has a great example of where generics would be useful, except they weren't used. For simplicity's sake, we will say it was a list (I know C# has its own list), but ...
1
vote
4answers
204 views

Member variables versus. state variables? [closed]

Sometimes we declare a member variable in the scope of class but we could do the same by providing input to and getting outputs of the functions. I am learning that member variables are to hold the ...
3
votes
1answer
130 views

Usage of this keyword in constructor chaining?

I am reading msdn documentation for this keyword. They gave three usages for this keyword as follows To qualify members hidden by similar names To pass an object as a parameter to other methods To ...
0
votes
1answer
114 views

Should I use a class as a wrapper?

Lets say I have a class representing a chemical compound class Compound(networkx.Graph): def __init__(self): super(Compound, self).__init__() And lets say that I want to add some ...
0
votes
1answer
100 views

Intermediate results as variables or only base values?

I have a object which has a few base variables (integers as example) and one intermediate variable for further processing. The intermediate variable can be calculated from the base vars. Now the ...
-2
votes
0answers
28 views

Why 'JRootPane' is-a 'JComponent' in javax.swing? [duplicate]

As per below code, I see that, setLayout() is being called on a JRootPane object instead of JFrame top level container in javx.swing world unlike java.awt, because it is told that swing's JFrame is ...
1
vote
1answer
53 views

Do the implementations of the Node interface in Web API violate Liskov Substitution Principle?

MDN article on Node interface states that interfaces [that inherit from Node interface] may return null in particular cases where the methods and properties are not relevant. They may throw an ...
3
votes
1answer
89 views

Why 'JButton' is-a 'Container' in javax.swing?

As per the class hierarchy in java.awt.*, class Button & class Label is-a class Component, and Component is not a Container, which make sense to me. As per the redesign of class hierarchy in ...
-1
votes
2answers
69 views

what is the difference between inclusion and inheritance [duplicate]

the question is self explanatory, I just want to know when to use the inclusion and when to use inheritance, and which one serves for re-usability. in other words, which one meets the Object ...
0
votes
1answer
68 views

Create an Inferface for different data sources but same datastructure [closed]

At the moment I have my sourcedata stored in different excel files but in the future I want to use a database. Since I dont want to write everything new when I have to change the source and maybe in ...
1
vote
2answers
52 views

Query on Recursive composition

For the below relation between Container and Componentin java.awt class hierarchy, I see that, in addition to is-a relation, class Container has composite relation with class Component with below ...
0
votes
1answer
76 views

Does class Availability makes programming as Object Oriented Language? [duplicate]

Does class Availability makes programming as Object Oriented Language ? Most of the people think that if there is Availability Class in a language, then that language becomes Object Oriented. Is it ...
1
vote
3answers
107 views

Exposition of Data Representation

I would like to know how the data representation is exposed in slide 7 of information hiding: Modifying an exposed data representation propagates to all code which directly accesses that ...
0
votes
2answers
161 views

if a c# interface contain only getter and setter definition, is it a code smell?

A project that I am working on has the following code for interface example: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Test { public ...
0
votes
1answer
101 views

Coupling in OOP Contracts: Many simple values of few complex objects as arguments?

When designing an OOP-based application, should one prefer to transfer information between objects through complex objects that do a lot of handling work, or should I retrieve the data from the ...
0
votes
2answers
175 views

Bad Practice using Auto Generated Classes for Data Access

I've seen this before but haven't found concrete reasons. When you add Entities to your EF model, EF auto generates classes for these entities. In terms of DataAccess, why is it preferred to not ...
-1
votes
3answers
136 views

Objects in smalltalk and c++ [closed]

I have a question based on SmallTalk and C++. In one of the programming languages books, there is a question like: "Does an object in Smalltalk require its own private stack? What about in C++?" ...
0
votes
3answers
209 views

I want to understand clearly why can't we instantiate an object of an abstract class [duplicate]

Can I get a clear explanation why why can't we instantiate an object of an abstract class. I know abstract is not real. But I want to know more why can't we instantiate an object of an abstract class. ...
0
votes
3answers
108 views

Communicating between unrelated components/objects

Imagine that I have a game, with Monsters, Missions, Vehicles, and of course their controllers and such, so a Monster class, Mission Controller class, Vehicle Controller class and so on. Suppose that ...
2
votes
1answer
216 views

Convert procedural code to object oriented

I have a PHP application (a web service). It consists of files grouped in directories by theme like :      /customer         /search.php with this example content : Auth::authenticate($options); ...
1
vote
2answers
124 views

Python: Object initialised inside a Class?

Is possible and, if so, common practice to initialize an object inside a class in Python? self.field = Class()
1
vote
1answer
94 views

Inheritance, Composition and Protocols

I'm reading a book on general object oriented concepts to try and gain a solid understanding of everything. One thing that is throwing me off is the difference between Inheritance and Composition. I ...
1
vote
1answer
154 views

Should we use data object (or the data transfer object) for sharing data between these three classes?

I found an article by Martin Fowler that has made me doubt my design choices, particularly about data objects. Martin Fowler has written an article about what he thinks is a code smell. In this ...