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)

34
votes
2answers
5k views

What did Alan Kay mean by “assignment” in The Early History of Smalltalk?

I have been reading The Early History of Smalltalk and there are a few mentions of "assignment" which make me question my understanding of its meaning: Though OOP came from many motivations, two ...
16
votes
3answers
1k views

Newbie question about Decorator design pattern

I was reading a programming article and it mentioned the Decorator pattern. I've been programming for awhile but without any kind of formal education or training, but I'm trying to learn about the ...
11
votes
6answers
1k views

How to implement only a part of an interface

When developing in OOP, sometimes an interface / contract is given by a library that you cannot alter. Let's call this interface J. Now you have an object of class A that consumes objects that ...
11
votes
4answers
1k views

How do I pass data the object-oriented way in PHP?

I find that even when working with a MVC framework (e.g. CodeIgniter), I regularly resort to passing nested arrays rather than objects. This doesn't follow my understanding of object-oriented well. ...
4
votes
4answers
200 views

Parameterize Agent Based Simulation (OOP-Question)

I'd like to hear my fellow programmer's thoughts on the issue of parametrizing agent based simulations: Consider: Simulation core, including geometry, collision tests, some rules Different agents ...
5
votes
2answers
1k views

What to do with private fields with getters and setters in Java [duplicate]

When are Getters and Setters Justified is an excellent question which focuses on using getters and setters as part of the external interface. What I am struggling with is ... by having getters and ...
9
votes
8answers
6k views

Is PHP a bad object oriented language? [closed]

I had a chance to have an interesting conversation with my co-workers. Most of them are flash action script or Java developers. We talked about how well php handles OOP. I said that PHP can handle ...
1
vote
2answers
120 views

Expanding knowledge of python / Next book and/or Topic to read/research

I have been programming python and web apps awhile now but never delved very deep into OOP. I use classes all the time but I am pretty sure i am not fully getting what I could get from OOP. So today I ...
5
votes
3answers
221 views

Is it acceptable practice to give an object a pointer to “the world”?

I often find myself in situations where objects need to communicate between each other. For example, a button might need to talk to various textboxes. Would it be proper to simply construct each ...
6
votes
1answer
270 views

“Super” vs “protected method” for running common code

In many langauges, super() lets you call the parent method which you have overridden. I've been using super in my Javascript (with fake object oriented implementation) to run common code for a long ...
5
votes
4answers
508 views

How to apply one of the OOP concepts (Closed for Modification and Open for extension)?

Days before, I created Question, Quiz, and Main classes. One Quiz has one or more Questions. From the main class I first create Question objects (the constructor accepts an array of numbers). The Quiz ...
83
votes
1answer
16k views

Should package names be singular or plural?

Often, in libraries especially, packages contains classes that are organized around a single concept. Examples: xml, sql, user, config, db. I think we all feel pretty naturally that these packages ...
21
votes
11answers
2k views

I've learned so much about OO programming I have no idea how to write procedural code. What's a good way to learn?

When I learned to program, I learned Object Oriented Programming very early on. For a while, I blundered around with my beautiful hammer, trying to use it for everything, partially because I had no ...
7
votes
1answer
1k views

Open/Closed principle and reopening Ruby Classes

In OOP there is the Open/Closed principle that states that "software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification". Taking in ...
8
votes
3answers
501 views

Can you Improve your programming skills by learning other language paradigms?

If so, can you tell me how learning a new paradigm changed your approach for solving programming problems even if the problem is in another paradigm/language/technology? I will really appreciated If ...
16
votes
12answers
1k views

What is the best way for a top-down procedural programmer to learn OOP?

I'm an old school top-down procedure programmer. I started with Turbo Pascal on the DOS environment. Every time I try to learn OOP on my own I stumble. I try and make OOP somehow fit into my ...
5
votes
5answers
381 views

When designing a protocol, is it better for a method to accept a single object of a specific type, or an array?

I'm currently designing a protocol for internal use, so it doesn't make a huge difference in this particular case, but it got me wondering: Is it better for a method to accept a single object of a ...
4
votes
6answers
2k views

3-Tier Object-Oriented Design Flaw?

I am going through training at my new job to use good object-oriented design with a 3-tier programming style. My supervisor says I have a design problem with my code: class Program { public ...
21
votes
12answers
3k views

Is developing games the best way to learn programming?

I heard recently an instructor mentinon that developing games was the best way to learn programming. Besides the fact that everything had to be created in code, he said you really get to fully ...
6
votes
8answers
364 views

What benefit do I get from good methodology?

One of my friends has worked for nearly 10 years, asked me why he needs to learn new things such as unit-testing, MVC, Multi-tier architecture (he creates 3-tier application but designs like 2-tier), ...
4
votes
3answers
443 views

Metaobject protocol:Why is it known as an important concept

Metaobject protocol is protocol for metaobjects in a programming languages. Although I understand it on simple terms, I want to know the reason and a summary of real world usage patterns of this ...
2
votes
3answers
371 views

How does one think about object oriented design and Aspect oriented Design for solution

I have worked on few projects in which both AOP and Object oriented paradigm were used. But, AOP usage was limited to logging only. I think AOP is a much more powerful technique. My question, to those ...
19
votes
5answers
4k views

Is objected oriented programming paradigm outdated since it is anti-modular and anti-parallel? [closed]

I have read the controversial article Teaching FP to freshmen posted by Robert Harper who is a professor in CMU. He claimed that CMU would no longer teach object oriented programming in the ...
2
votes
2answers
906 views

Javascript project for analysis and learning

I started learning and using Javascript now for about six months. First i started by following different tutorial on the internet. Testing them, playing with them and trying different variation. ...
8
votes
7answers
3k views

How to explain OOP to a matlab programmer? [closed]

I have a lot of friends who come from electrical / physical / mechanical engineering background, and are curious about what is "OOP" all about. They all know Matlab quite well, so they do have basic ...
9
votes
4answers
1k views

How does thinking on design patterns and OOP practices change in dynamic and weakly-typed languages?

There is a fairly helpful question already along these lines ("Non-OOP Design Patterns?"), but I am more curious about a transitional point of view for someone just getting started with dynamic and ...
3
votes
4answers
633 views

How do you remember encapsulation types for effective use?

I've been attempting to learn C#.NET for the past month or so, and the array of ideas that seems to always trip me up is encapsulation. As this is one of the three pillars of OOP, I feel that I am ...
15
votes
10answers
5k views

Why are inheritance and polymorphism so widely used?

The more I learn about different programming paradigms, such as functional programming, the more I begin to question the wisdom of OOP concepts like inheritance and polymorphism. I first learned ...
3
votes
2answers
853 views

How do you represent container classes in UML?

When drawing out quick class diagrams, I'm often at a loss how to represent classes that are used just to pass data around between various parts of the program. I've been putting them out in the ...
9
votes
5answers
1k views

How do we know to favour composition over generalisation is always the right choice?

Whether an object physically exists or not, we can choose to model it in different ways. We could arbitarily use generalisation or composition in many cases. However, the GoF principle of "favour ...
4
votes
9answers
845 views

Does single inheritance limit what we can do with generalisation?

As a rule of thumb, generalisation is used only in specific circumstances. For example, when we can say that X is literally a subclass of Y. So, we can happily say that a Horse is a subclass of ...
30
votes
17answers
9k views

How can I feel more confident about my programming skills? [closed]

Programming isn't alien to me. I first starting doing markup (HTML, now please don't laugh at me) when I was 12 and a little bit of BASIC when I was 13 (I knew much about Flowcharts, Pseudocodes at ...
31
votes
12answers
10k views

Why does PHP have interfaces?

I noticed that as of PHP5, interfaces have been added to the language. However, since PHP is so loosely typed, it seems that most of the benefits of using interfaces is lost. Why is this included in ...
20
votes
12answers
1k views

SOLID vs. Avoiding Premature Abstraction

I understand what SOLID is supposed to accomplish and use it regularly in situations where modularity is important and its goals are clearly useful. However, two things prevent me from applying it ...
19
votes
11answers
2k views

Is pure oop necessary [closed]

Please don't direct me to this post: http://stackoverflow.com/questions/1551/how-to-think-in-oo. I have read it and still have no answer. I have programmed c++ for years and was taught that ...
83
votes
14answers
22k views

Where does this concept of “favor composition over inheritance” come from?

In the last few months, the mantra "favor composition over inheritance" seems to have sprung up out of nowhere and become almost some sort of meme within the programming community. And every time I ...
8
votes
7answers
3k views

Structured programming versus OO programming

I am making a presentation that shows the differences between structural and object oriented programming and I want to illustrate why people need OOP with an example where applying OOP concepts will ...
12
votes
6answers
2k views

Real-world scenarios for protected methods

Today I noticed that I basically never use protected methods in C++ code, because I rarely feel the need to call non-public methods of a parent. I do use protected in Java in the template method ...
8
votes
3answers
4k views

Differences between “Java OOP” and “Pythonic OOP”? [closed]

I started with ActionScript 2.0 and then went on with Java. I have learned, or at least used, a bunch of languages since then, including Python (probably my favorite). I'm afraid that my style of ...
82
votes
8answers
67k views

Aggregation vs Composition

I understand what composition is in OOP, but I am not able to get a clear idea of what Aggregation is. Can someone explain?
3
votes
4answers
1k views

Objective-C Categories and Sprawling Classes

The generally accepted programming practices I've come across tend to advise against big, sprawling classes. Does using Objective-C categories change the conventional wisdom somehow? Is it more ...
9
votes
12answers
6k views

Why must we learn Procedural programming before we learn Object-oriented programming [closed]

I'm in the 4th year at an IT university now, and when I talk with my professor about this topic he rejects my opinion and gives me a very heavy criticism (in my university, we were being taught C ...
0
votes
2answers
429 views

what's proper class name for manager/browser/editor

I've read somewhere that it's a bad idea to name classes after verbs (manager/browser/editor) but what's the proper name for manager/browser/editor? EDIT: the problem is that system could turn in a ...
11
votes
1answer
2k views

How to learn to translate real world problems to code? [closed]

I'm kind of a beginner to Java and OOP and I didn't quite get the whole concept of seeing a real world problem and translating it to classes and code. For example, I was reading a book on UML and at ...
26
votes
9answers
3k views

How to REALLY start thinking in terms of objects? [closed]

I work with a team of developers who all have several years of experience with languages such as C# and Java. Most of them are young enough to have been shown OOP as a standard way to develop ...
13
votes
8answers
590 views

How might one teach OO without referencing physical real-world objects? [closed]

I remember reading somewhere that the original concepts behind OO were to find a better architecture for handling the messaging of data between multiple systems in a way that protected the state of ...
6
votes
3answers
1k views

Duplication in parallel inheritance hierarchies

Using an OO language with static typing (like Java), what are good ways to represent the following model invariant without large amounts of duplication. I have two (actually multiple) flavours of the ...
5
votes
5answers
866 views

In C++, is it a reflection of poor software design if objects are deleted manually?

With the advent of smart pointers, is it a sign of poor design if I see objects are deleted? I'm seeing some software components in our product that people are still doing this. This practice strikes ...
25
votes
13answers
6k views

Why are objects passed by reference?

A young co-worker who was studying OO has asked me why every object is passed by reference, which is the opposite of primitive types or structs. It is a common characteristic of languages such as Java ...
1
vote
1answer
678 views

DB Schema for ACL involving 3 subdomains

I am trying to design a database schema for a web app which has 3 subdomains: a) internal employees b) clients c) contractors. The users will be able to communicate with each other to some degree, ...