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)

12
votes
7answers
886 views

Getting My Head Around Immutability

I'm new to object-oriented programming, and one concept that has been taking me a while to grasp is immutability. I think the light bulb went off last night but I want to verify: When I come across ...
4
votes
3answers
603 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 ...
12
votes
9answers
1k views

Avoiding Object Oriented Pitfalls, Migrating from C, What Worked for You?

I've been programming in procedural languages for quite some time now, and my first reaction to a problem is to start breaking it down into tasks to perform rather than to consider the different ...
3
votes
1answer
118 views

Objected oriented application exit

We are writing a program that does a standard "auto update software on startup". If the software finds an update ready, it will start the update process and then exit (and not run the program). We ...
11
votes
5answers
2k views

Advantages to Multiple Methods over Switch

I received a code review from a senior developer today asking "By the way, what is your objection to dispatching functions by way of a switch statement?" I have read in many places about how pumping ...
5
votes
6answers
3k views

Is java a good start to learn OOP? [closed]

I have good teacher who understands OOP. However, the language which he is expert in is Java and I don't want to learn Java. My question is, do you think if I learn OOP using Java I will waste my ...
0
votes
3answers
864 views

Improving Cohesion and Coupling of Classes

I am given this set of code and need to suggest ways to improve the code's cohesion and coupling of the classes. But I thought these classes are quite well de-coupled since it looks like they are ...
4
votes
4answers
611 views

Should strategy objects have state?

I have an application object that needs to validate some data. The particular validation algorithm isn't known until runtime, so I pass a validation object to it, using the strategy pattern. The ...
39
votes
2answers
6k 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 ...
11
votes
7answers
2k views

From a design perspective, what are the best practices for logging? [closed]

I want to add logging to an application I'm currently working on. I've added logging before, that's not an issue here. But from a design perspective in an object-oriented language, what are the best ...
2
votes
4answers
310 views

Function locals: variable used in just one function

In OOP, static scope means the scope is linked to the class, and instance scope is linked to a specific instance of the class. Some languages support static locals, which allow a value to be retained ...
6
votes
1answer
4k views

Python programming patterns and practices? [closed]

What are the best python programming patterns and practices you are using every day? I don't mean only design patterns (there are lot of OO design patterns that can be used in python), I mean pure ...
1
vote
1answer
2k views

Python Class Layout - Conventions

What is the proper or standard way to layout a class. If a class where to have attributes, methods, private attributes, private methods, class property (methods), and class methods. I am done 99% of ...
12
votes
6answers
2k 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
2k 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
214 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
2k 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 ...
1
vote
2answers
132 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
229 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
296 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 ...
119
votes
1answer
26k 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 ...
20
votes
11answers
3k 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? [closed]

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 ...
9
votes
3answers
573 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 ...
5
votes
5answers
390 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 ...
6
votes
8answers
419 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), ...
20
votes
5answers
6k 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 ...
1
vote
5answers
975 views

Php: Whats my next step? [closed]

So in college I started learning Php, mostly starting with the Larry Ullman books. I got a job at a company after, where I was able to learn some stuff from the higher up guys. Since then, I've done ...
5
votes
2answers
538 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 ...
4
votes
2answers
1k 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 ...
10
votes
7answers
5k 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
3k 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 ...
1
vote
2answers
528 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 ...
25
votes
13answers
9k 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
780 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, ...
4
votes
2answers
199 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. ...
6
votes
2answers
901 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 ...
6
votes
6answers
851 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 ...
5
votes
1answer
504 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) ...
4
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 ...
5
votes
7answers
3k 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?
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 ...
1
vote
5answers
780 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?
14
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 ...
5
votes
3answers
2k 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 ...
4
votes
6answers
451 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 ...
3
votes
3answers
759 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 ...
1
vote
3answers
450 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)-> ...
12
votes
4answers
1k 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 ...