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)

0
votes
2answers
141 views

Is hooking Data access method on wrong object detrimental for a developer

In a simple application I am creating there are Admin and users where admin can create users. Right now I am creating Classes that encapsulate database CRUD calls with methods. For example: ...
3
votes
3answers
322 views

Do simple accessors and mutators benefit from commented block headers?

Short Question Is it necessary to add the function header comments for simple accessors and mutators? Example u8 OBJ_get_state_x(void) {return obj.state_x;} void OBJ_set_state_x(u8 x) ...
22
votes
3answers
17k views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
3
votes
1answer
296 views

Do “Builder” static methods violate SOLID?

I am writing a class which consists mostly of data storage responsibilities. The context for the use of this class will, in general, be retrieving an array of objects of this type for display later. ...
27
votes
2answers
5k views

What are the advantages of prototype-based OOP over class-based OOP?

When I first started programming Javascript after primarily dealing with OOP in context of class-based languages, I was left confused as to why prototype-based OOP would ever be preferred to ...
1
vote
2answers
236 views

What it is a data structure of a certain type called?

I'll try to keep this as much language agnostic as I can but I'll give the examples in C# since I now know how to solve it that language. The question came to mind when I was thinking of how could I ...
4
votes
8answers
1k views

What is the term that describe objects representing both logic and data?

The reason I am asking this question is I want to know how to properly call an architecture where classes have either data or logic but not both. I know this goes against object orientation and ...
14
votes
14answers
6k views

How can I explain the usefulness of Inheritance? [closed]

When trying to explain the concept of Inheritance in OOP, the common example is often the mammals example. IMHO, this is really a bad example, because it will lead the newbies to use this concept the ...
4
votes
5answers
683 views

Proper OO design for State and Command

I'm working (a bit) on a (turn-based strategy) game. There are two classes relevant for the question: State: This is an immutable class, which exposes all its fields (either via getters or another ...
7
votes
2answers
2k views

How to remove duplicate code (in general)?

In an OO language (e.g. but not limited to Java) how do you fix duplicate code depending on the scope of it's occurrence? I would start with (for example) in the same class (scope) perform the ...
6
votes
4answers
237 views

Injecting properties/settings into an application

In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The ...
6
votes
8answers
2k views

Which is best programming style to start learning to programm POP or OOP? [closed]

If somebody has to start learning to program, where should he/she start? Should he start to write procedure-oriented programs or jump to OOP?
10
votes
4answers
16k views

In simple words what are are the purposes of abstract classes and/or interfaces? [duplicate]

I have to explain to some students the use of abstract classes and interfaces, as I have a very tecnical background, I would like to know if you would help me to define an easy explanation for junior. ...
8
votes
8answers
3k views

C++ to friend or not to friend

I have an object oriented programming with c++ course this semester at college and we were learning about friend functions. I instinctively dislike them for their ability to bypass the security that ...
9
votes
3answers
840 views

What is the object-oriented thought process? [closed]

I've been studying OOP in conjunction with Zend's MVC implementation for the past few months. I'm pretty new to programming, generally, but I feel strongly that I should learn things the 'right' way, ...
10
votes
3answers
2k views

Applying SOLID principles

I am quite new to the S.O.L.I.D. design principles. I understand their cause and benefits, but yet i fail to apply them to a smaller project which I want to refactor as a practical exercise to use the ...
6
votes
4answers
910 views

Why were concepts (generic programming) conceived when we already had classes and interfaces?

Also on stackoverflow.com: I understand that STL concepts had to exist, and that it would be silly to call them "classes" or "interfaces" when in fact they're only documented (human) concepts and ...
5
votes
1answer
965 views

Object oriented EDI handling in PHP

I'm currently starting a new sub project where I will: Retrieve the order information from our mainframe Save the order information to our web-apps' database Send the order as EDI (either D01b or ...
5
votes
1answer
2k views

Is functional decomposition really an antipattern?

While I was reading The worst anti-patterns you have came across, I clicked on the link in this post to land on the web site about anti-patterns. And the ...
2
votes
2answers
140 views

Where does “isolating complexities” lie in the realm of design principles?

I was just curious, it's something I think most people are aware of as a technique: You have some abominable data that simply must be parsed and you can do nothing to simplify the algorithm for doing ...
2
votes
1answer
246 views

How to best annotate MVC custom action filters?

As I get deeper into the area of ASP.NET MVC 3, I feel like I'm finding a lot of very nice technical nuggets as well as new ways of doing things versus classic ASP.NET. One of those "nuggets" is ...
1
vote
3answers
641 views

How do you manage cross-class dependencies on destruction/design (more of a C++ question)

So if I understand correctly, from SOLID design principles, every class should keep a single responsibility. So there should be one class that creates and manages a resources, a second class that ...
4
votes
3answers
2k views

Is the “Objects First” approach a good idea? [closed]

Do you think programming novices should learn objects from day 1, as seen in the book "Objects First With Java: A Practical Introduction Using BlueJ" by David Barnes? Or do you think this is a bad ...
5
votes
1answer
322 views

Influences on the design of Dynamic objects by Alan Kay

Alan kay in his paper, The power of Context pdf link, page 8, enumerates some of his motivations for dynamic objects. Some of the influences like Paper on lisp, early paper on the design of functional ...
11
votes
2answers
19k views

How to deal with OOP design problems in interviews? [closed]

This is a question where I seek guidance from fellow/senior developers to get into my dream company - it's a pioneer in OOP and Agile. I've already failed once to clear an interview. One part I feel ...
5
votes
10answers
31k views

How best to learn OOP concepts/principles practically? [closed]

I wanted to learn object oriented programming language, I dont want it for any purpose just to know the whole concept of OOP. So can anyone tell me which language I should start learning?
8
votes
3answers
1k views

Keeping an MVC model loosely coupled from the DB?

I like to keep my code testable and have decided to go with the Dependency-Injection strategy for my current MVC framework, which definitely has proven to be a great way to ensure loosely coupled ...
4
votes
2answers
3k views

Best JavaScript Coding Structure Using Object Literal?

Object Literal has no doubt been established in recent years as one of the essential components to best JavaScript coding practices. However, I am not very sure about what is the best way to structure ...
15
votes
1answer
4k views

Dijkstra quote on object-orientation? [closed]

I came across the following supposed Dijkstra quote on object-orientation Object-oriented programming is an exceptionally bad idea which could only have originated in California However even my ...
2
votes
3answers
367 views

Want to know performance issues of Class types & access modifiers

Someone suggested me to mark classes as SEALED that are not being inherited anywhere. I was using default style and was not concerned with the type of class. At present I don't have a benchmark tool ...
15
votes
5answers
929 views

Is SRP (Single Responsibility Principle) objective?

Consider two UI designers who want to design "user attractive" designs. "User attraction" is a concept that is not objective and only resides in the mind of designers. Thus designer A could for ...
20
votes
11answers
2k views

Is information hiding more than a convention?

In Java, C# and many other strongly-typed, statically checked languages, we are used to write code like this: public void m1() { ... } protected void m2() { ... } private void m2() { ... } void m2() ...
1
vote
2answers
938 views

Whats the best book to master OO language, say C#? [closed]

I have quite some experience in software development. In the initial stages I worked on a really large project, with dozens of projects involved in it, hundreds of large files each with 10s of ...
38
votes
10answers
14k views

Can't I just use all static methods?

What's the difference between the two UpdateSubject methods below? I felt using static methods is better if you just want to operate on the entities. In which situations should I go with non-static ...
11
votes
3answers
2k views

Class Versus Struct

In C++ and other influenced languages there is a construct called Structure (struct), and another called the class. Both are capable of holding functions and variables. Some differences are: Class ...
22
votes
9answers
32k views

Why should I declare a class as an abstract class?

I know the syntax, rules applied to abstract class and I want know usage of an abstract class Abstract class can not be instantiated directly but can be extended by other class What is the ...
15
votes
4answers
913 views

best way to “introduce” OOP/OOD to team of experienced C++ engineers

I am looking for an efficient way, that also doesn't come off as an insult, to introduce OOP concepts to existing team members? My teammates are not new to OO languages. We've been doing C++/C# for ...
3
votes
5answers
906 views

How to convince my boss to switch to OOP PHP? [closed]

We have been trying for months to convince my boss to switch to OOP php, but each time, he takes out his previous experience with programming and convinces us other wise. i need to talk like a boss ...
11
votes
3answers
2k views

generic programming, how often is it used in industry

I do programming in an academic setting at the moment, so I can use whatever I want. I'm using the boost graph library for a few things, and I'm wondering whether investing effort in understanding GP ...
2
votes
3answers
2k views

How to handle large scale js+jquery projects using well written, Object-Oriented JavaScript and jQuery code? [closed]

I love the whole user experience/interface thing and put a lot of jQuery and JavaScript (pure JavaScript for HTML5 stuff, like canvas, file API, etc). The problem I face now is that my codes are ...
7
votes
7answers
2k views

Object-Oriented Class Design

I was wondering about good object oriented class design. In particular, I have a hard time deciding between these options: static vs instance method method with no parameters or return value vs ...
10
votes
5answers
2k views

Can an object oriented program be seen as a Finite State Machine?

This might be a philosophical/fundamental question, but I just want to clarify it. In my understanding a Finite State Machine is a way of modeling a system in which the system's output will not only ...
30
votes
9answers
4k views

Are abstract classes / methods obsolete?

I used to create a lot of abstract classes / methods. Then I started using interfaces. Now I am not sure if interfaces aren't making abstract classes obsolete. You need a fully abstract class? ...
1
vote
1answer
550 views

Views, View Controllers, Properties and Object-Oriented Programming

I'm new to OOP, having been a procedural programmer for many years. I'm learning iOS development in Objective-C and could use some clarity on when and how objects and properties are used. Say I have ...
3
votes
2answers
387 views

Application design question regarding saving files

I am working on an application in C# and I am having some extreme difficulty solving this design issue. Basically the application allows users to create cook books. A user can click "new book" and ...
12
votes
8answers
552 views

Inheritance gone wrong

I have some code where a good inheritance model has gone downhill and I am trying to understand why and how to fix it. Basically, imagine you have a Zoo hierarchy with: class Animal class Parrot : ...
4
votes
2answers
356 views

Polymorphism and the potential security issues

I just read an article on MSDN about reasons for declaring classes as sealed. In the last paragraph, Eric Lippert says: 4) Secure. the whole point of polymorphism is that you can pass around ...
8
votes
3answers
19k views

What does “S” stands for in OOPS?

I have searched for the full form of "OOPS" in Google, but unfortunately, there are many ambiguous answers. Some say it's "Systems", and some say it's "Structure", and some have even mentioned it as ...
4
votes
4answers
1k views

Can the strategy pattern be overused?

Example: A file, representing a serialized version of an object, needs to be read and deserialized. It would simple to implement this if we only cared about a single serialization format, but many ...
7
votes
4answers
484 views

OOP design question

I'm working on an application written in PHP using OOP principles. The classes in my application usually represent a table in the database; for instance, 'student', 'teacher', 'class', 'schedule', ...