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)

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
889 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
704 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
19k 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
728 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
740 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
684 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
444 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
8k 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
698 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
302 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
519 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 ...
58
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 ...
3
votes
6answers
430 views

Why are interfaces not casteable/ducktypeable?

One thing that always irked me (in C#) was that there's a hard dependency between an interface/abstract class and the implementing class and assembly. Meaning that that if two different assemblies ...
6
votes
9answers
523 views

Is there a programming language with not a tree but tags idea behind OOP?

I'm thinking about tree structures, and I feel that I don't like them. It's like when you have a shop, then you try to put all products to tree-like catalog, and then you need to place one product to ...
1
vote
3answers
440 views

PHP ORM style of querying

Ok so I have made an ORM library for PHP. It uses syntax like so: *(assume that $business_locations is an array)* Business::type(Business:TYPE_AUTOMOTIVE)-> ...
2
votes
3answers
655 views

What is a “pretty and proper OO” way for handling sessions and authentication?

Is coupling these two concepts a bad approach? As of right now I'm delegating all session handling and whether or not a user desires to logout in my config.inc file. As I was writing my Auth class I ...
2
votes
5answers
3k views

Best way to learn Java if you already have an OOP background, like ActionScript 3? [closed]

I'm looking to learn Java, but I don't want to get a book that is going to tell me what an object is, how OOP works, etc. I know this from my existing ActionScript 3 work. One idea is to look at all ...
11
votes
5answers
1k views

Do you leverage the benefits of the open-closed principle?

The open-closed principle (OCP) states that an object should be open for extension but closed for modification. I believe I understand it and use it in conjunction with SRP to create classes that do ...
7
votes
3answers
2k views

OOP oriented PHP app source code samples and advice

The day I have been dreading has arrived. I never felt OOP or good software design was important(I knew they were important, but I thought I could manage without them.). However having read otherwise ...
8
votes
4answers
757 views

Staying OO and Testable while working with a database

What are some OOP strategies for working with a database but keeping things unit testable? Say I have a User class and my production environment works against MySQL. I see a couple possible ...
6
votes
12answers
974 views

Any recommendations on a good Objected-Oriented book [closed]

I'm looking to really grasp OO once and for all. Any recommendations on a good Objected-Oriented book? I program in .Net, so if it's .Net oriented all the better. Regards,
8
votes
10answers
1k views

What should be first - functionality or design? [duplicate]

I've started reading a book from Head First series about OOP and Design. In a first chapter it is stated I have to worry about design of my application just after basic functionality is ready. Basic ...
4
votes
6answers
8k views

When is C a better choice than C++? [closed]

I can't imagine that there's any reason not to use the OOP features of C++. It's is just as fast as C, and - what's more important to me - it's transparent, just as C. (I mean "transparent" that I ...
2
votes
4answers
146 views

Confusion in definitions of a method and a methodology in the book “OOAD with Applicatons” (Booch et al)

I am reading the book Object-Oriented Analysis and Design written by Grady Booch and others. In the Section : I Concepts in a subsection Bringing Order to Chaos authors suggest to separate between a ...
10
votes
7answers
2k views

Is it bad code smell if private method calls public one?

Is it bad code smell to call public method in private method of same object instance?
10
votes
5answers
2k views

Which paradigm to use for writing chess engine?

If you were going to write a chess game engine, what programming paradigm would you use (OOP, procedural, etc) and why whould you choose it ? By chess engine, I mean the portion of a program that ...
6
votes
5answers
582 views

Object model design: collections on classes

Consider Train.Passengers, what type would you use for Passengers where passengers are not supposed to be added or removed by the consuming code? I'm using .NET Framework, so this discussion would ...
4
votes
4answers
231 views

objects, classes, types

How does an object oriented programmer understand the word "type"? I'm not aware of there being a type theory for object oriented programming because whenever someone mentions type theory it is always ...
11
votes
4answers
1k views

Nested Classes: A useful tool or an encapsulation violation?

So I'm still on the fence as to whether or not I should be using these or not. I feel its an extreme violation of encapsulation, however I find that I am able to achieve some degree of encapsulation ...