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)

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
876 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 ...
32
votes
17answers
10k 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
12k 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 ...
18
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 ...
92
votes
14answers
24k 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
4k 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 ...
13
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 ...
9
votes
3answers
5k 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 ...
100
votes
9answers
82k 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
7k 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
457 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
3k 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
4k 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
597 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 ...
7
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
895 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
7k 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
713 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, ...
2
votes
7answers
1k views

Architectural patterns for interaction beyond MVC? [closed]

We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment. What are some other architectural ...
4
votes
3answers
383 views

MVP Pattern Philsophical Question - Security Checking in UI

I have a philosophical question about the MVP pattern: I have a component that checks whether a user has access to a certain privilege. This privilege turns on or off certain UI features. For ...
6
votes
5answers
20k views

Interview Questions in OOP [closed]

I faced the below interview questions in OOP under PHP language. Kindly clear my clarifications regarding this. I am very confused. As i am a beginner to OOP i got too confused. Could anyone clarify ...
6
votes
2answers
743 views

OOP for unit testing : The good, the bad and the ugly

I have recently read Miško Hevery's pdf guide to writing testable code in which its stated that you should limit your classes instanciations in your constructors. I understand that its what you should ...
4
votes
2answers
197 views

Is it better to load up a class with methods or extend member functionality in a local subclass?

Which do you like better? Class #1: public class SearchClass { public SearchClass (string ProgramName) { /* Searches LocalFile objects, handles exceptions, and puts results into m_Results. ...
5
votes
6answers
752 views

How do you know when to split an object method into 2 or more other methods?

I know this is a very basic question, but I sometimes find myself struggling to figure out when to split a single object method into multiple methods. For example, I am trying to set up an ACL using ...
3
votes
4answers
10k views

What exactly are SDLC and OOP?

I have been asked "What are SDLC and OOP?" many times in job interviews but I am still not sure how to answer this question. I am a web developer for quite some time but I still have problem with ...
6
votes
7answers
2k views

What exactly is OO reuse?

And why is it often talked about? Like I know what OO programming is obviously... but people always say "Oh OO reuse is the biggest programming myth ever". What exactly does this mean?
3
votes
4answers
2k views

How to learn the practical uses of design patterns

I use OOP programming with inheritance, but I've not yet used interfaces.I want to learn how to use design patterns, but I'm finding them very difficult to learn. Is there is any way to learn design ...
3
votes
3answers
2k views

What is the difference between instantiating and loading a class in Java?

In Java world, there are some scenarios where I see developers used to load the class rather than instantiation. What is the difference between instantiating and loading a class?
10
votes
6answers
688 views

Where, in an object oriented system should you, if at all, choose (C-style) structs over classes?

C and most likely many other languages provide a struct keyword for creating structures (or something in a similar fashion). These are (at least in C), from a simplified point of view like classes, ...
5
votes
1answer
448 views

Architectural Composition Languages

Recently stumbled upon this paper (PDF) talking about ACLs, or Architectural Composition Languages. They're a fusion of two earlier lines of research: Architectural Definition Languages (such as UML) ...
26
votes
11answers
9k views

What is Object Oriented Programming ill-suited for?

In Martin Fowler's book Refactoring, Fowler speaks of how when developers learn something new, they don't consider when it's inappropriate for the job: Ten years ago it was like that with objects. ...
0
votes
5answers
2k views

Why does the use of interface-based programming appear to be limited to behaviour?

I have been doing a little thinking about inheritance vs. realization vs. composition. I am not about to post the whole detail here. So I was wondering, when we are not talking about creating ...
2
votes
4answers
198 views

Models, controllers, and code reuse

I have a blog where users can post comments. When creating a comment, various things happen: creating the comment object, associations, persisting sending notification emails to post's author ...
0
votes
5answers
704 views

Should you be an OOP expert if you're developing in ASP.NET?

Should you be an OOP expert if you're developing in ASP.NET?
6
votes
15answers
2k views

Why OOP is enforced in Java and C#? [closed]

In many other languages like C++ and Javascript, OOP is optional. Procedural code is ok. But in languages like Java and C#, OOP is somewhat enforced. Everything is to be a part of a class or an ...
12
votes
6answers
3k views

Convert from Procedural to Object Oriented Code

I have been reading Working Effectively with Legacy Code and Clean Code with the goal of learning strategies on how to begin cleaning up the existing code-base of a large ASP.NET webforms application. ...
3
votes
4answers
3k views

PHP, structural or OOP based language? [closed]

I would like to discuss why is PHP called a structural language? what are the OO concepts that cannot be implemented using PHP?
13
votes
6answers
2k views

Method chaining vs encapsulation

There is the classic OOP problem of method chaining vs "single-access-point" methods: main.getA().getB().getC().transmogrify(x, y) vs main.getA().transmogrifyMyC(x, y) The first seems to have ...
11
votes
12answers
2k views

Is C++ not suitable for OOP? [closed]

I read somewhere in one of the answers to a question here (can't remember which) that C++ is not suitable for object-oriented programming. There was some mentioning that you could make use of its ...
0
votes
2answers
303 views

Trying to understand Single Responsiblity Principle [closed]

I'm having a difficult time understanding the Single Responsibility Principle. What should I look for to evaluate the various sources of information on the matter? What should I look for in ...
4
votes
3answers
280 views

Deciding between obj->func() and func(obj)

I was thinking about this when I was starting to set up some code for a new project: are there any rules of thumb for when a method should be part of an object, and when it should be a stand alone ...
5
votes
3answers
1k views

Why make JavaScript class based?

JavaScript is a prototype language. To turn it into a class based language adds little value? I am not talking about best-practice here. I remember reading an article from way back, which claimed that ...
5
votes
2answers
523 views

how to work with people who thinks procedurally in an object oriented project [closed]

I'm working on a project which heavily uses OOP Design principles. But, one of my colleague tends to do everything in procedure oriented manner. I gets irritated by seeing procedure oriented code ...
59
votes
4answers
6k views

So what *did* Alan Kay really mean by the term “object-oriented”?

Reportedly, Alan Kay is the inventor of the term "object oriented". And he is often quoted as having said that what we call OO today is not what he meant. For example, I just found this on Google: ...
2
votes
2answers
12k views

What are some good Object Oriented Design (OOD) interview questions? [closed]

I'm looking to prepare for a job interview and I wanted to go over some good Object Oriented Design (OOD) questions. Here are some of the OOD concepts that should give a good starting point: ...
13
votes
3answers
1k views

Pure virtual or abstract, what's in a name?

While discussing a question about virtual functions on Stack Overflow, I wondered whether there was any official naming for pure (abstract) and non-pure virtual functions. I always relied on ...
26
votes
6answers
3k views

Does learning a functional language make a better OOP programmer? [closed]

As a Java/C#/C++ programmer I hear a lot of talk about functional languages, but have never found a need to learn one. I've also heard that the higher level of thinking introduced in functional ...