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 (2)

7
votes
2answers
193 views

What makes OOP “good”? [duplicate]

It's fairly obvious that OOP is viewed as a sort of silver bullet of programming today. In any computer science course, the merits of OOP are heralded. I would like to know why people like OOP. To be ...
-4
votes
2answers
240 views

Why is C++ preferred over C for commercial applications? [closed]

I program in C mostly. However, it is pretty obvious that many more commercial applications are done in C++. As far as I can tell, C++ is a very complex language, with seemingly convoluted syntax and ...
0
votes
0answers
10 views

Not defined variables display [migrated]

So here is an issue: We have a pretty large CMS for fleets and sometimes people leave some optional input fields as blank, displaying that information on the screen really doesn't help anyone, and ...
8
votes
3answers
265 views

Object Oriented Programming in JavaScript. Is there life without it? [duplicate]

At our company we have pretty large body of PrototypeJS based JavaScript code, which we are porting to jQuery for several reasons (not really important here). I'm trying to set up coding guidelines to ...
2
votes
6answers
306 views

Naming functions that retrieve a value

I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if ...
0
votes
0answers
37 views

php OOP - cant change value from outside class [migrated]

this is my first attempt with oop i want to modify some values from a class, but i can't figure out how to do that from a different file / if i try to do that from where i have the class is working ...
64
votes
18answers
3k views

Is it poor programming practice to pass parameters as Objects? [duplicate]

So, we've got a guy who likes to write methods that take Objects as parameters, so they can be 'very flexible'. Then, internally, he either does direct casting, reflection or method overloading to ...
2
votes
2answers
105 views

MVC framework that uses classes instead of methods for actions

In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of ...
-1
votes
2answers
41 views

Beans, DTOs, & Non-Internal Classes as Data in General - Acceptable or OOP-Murdering Antipatterns? [closed]

Am I not understanding encapsulation? What's with all this data out in the line of function-spaghetti disguised as one-method classes fire? Beans and DTOs are everywhere. Isn't it better design to ...
4
votes
1answer
83 views

Xerox SOLID example in PHP

There is a good example on Wikipedia regarding the violation of SOLID principles. The ISP was first used and formulated by Robert C. Martin while consulting for Xerox. Xerox had created a new ...
0
votes
3answers
203 views

The similarities between Functional Programming & Object Oriented-Imperative Programming? [closed]

The heading couldn't say it anymore better. I understand the differences between the paradigms but i would like to know the similarities between them. I'm looking for things that affect the program ...
1
vote
2answers
117 views

How to make big chunk of hardcoded menuitems in a programmable way

So in the javascript app, we have a lot of repeated chunk of menu items with the specific settings: URL, Name, Title, etc etc (these settings sometimes can be optional). Here is the gist of the ...
1
vote
2answers
167 views

Statistics collection engine for C++ systems

We have a research project with idea->prototype->statistics development cycle. Anyway, our final product is a prototype, so the statistics collection suite is not used persistently. Supposing I have ...
6
votes
7answers
248 views

Chain class behaviour

I have a Bird class. A bird can learn and a bird can fly (methods). A bird can only fly after it learns. Considering both methods are public. How can you make this clear to another fellow developer. ...
1
vote
2answers
169 views

Object Orientation done right with PHP [closed]

I've started to work with web development using PHP as server side programming language. In that time I didn't know the benefits of object orientation and had a hard time trying to write more ...
2
votes
2answers
104 views

Where should I parse data obtain with a DAO

I have a DAO that brings data from a web service, that data comes in a string, in the likes of: *NAME|John Doe *DATEOFBIRTH|1978-23-01*ID|anID123 (...) I have a DTO that I wanna fill up with the ...
1
vote
2answers
102 views

Search and Replace in MVC

What would be a good MVC/OOP/GRASP/SOLID structure for a search/replace functionality. Methods: search/searchNext/replace/replaceAll. I'm interested only in the PHP arhitecture and how a professional ...
3
votes
7answers
321 views

OOP (php) for beginners - some unclarities

I started reading some tutorials about OOP, because I want to learn the basics. I have a question about it. I understand how you can have a object "Car" and give it a color like this ...
-1
votes
0answers
7 views

java script date popup is not working in firfox [migrated]

The following is the function for date selection. The code is working in IE but it is not working in Firefox. The problem coming at selecting a day.iam not able to select a day in Firefox. function ...
1
vote
3answers
129 views

Is there any situation when there's no alternative to instanceof?

It seems to me that instanceof comes from the land of functional programming and is a watered down version of pattern matching and that the OO altenative to it should be dynamic dispatching. In OO ...
2
votes
6answers
427 views

OOP principles and method names

class Boxer: def punch(self, punching_bag, strength): punching_bag.punch(strength) class PunchingBag: def punch(self, strength): print "Punching bag punched with strength", ...
6
votes
4answers
331 views

Besides polymorphism, what's compelling about OOP? [duplicate]

When I first came to OOP (at first in Java, and then C++) after years of working in C and VB, it was amazing. The idea of extending existing behaviour and operating generically over things of related ...
-2
votes
1answer
197 views

Object-Oriented Programming With ANSI-C [closed]

I am trying to expand my understanding the history and involvement of OOP. Recently I have been looking into OOP in ANSI-C, which is described in Object-Oriented Programming With ANSI-C by Axel ...
0
votes
2answers
73 views

What is the convention regarding class names that may already exist in the ORM?

This is a generic question about class names and ORMs, but for context; I'm working on a Flask web app in Python using SQLalchemy. I'm struggling with naming a new class that will contain the ...
-4
votes
1answer
252 views

Is OOP becoming functional programming? [closed]

Every one knows immutability is the way to go - everyone recommends making your classes as immutable as they can be... but are immutable types still objects? I have doubt - to me there are simply ...
10
votes
2answers
455 views

General thought process for “How would you build this website/app” interview questions

I've collected a bunch of interview questions like "Describe how you would design a photo album application", "Describe how you would design this particular feature of this particular website" (e.g. ...
3
votes
4answers
256 views

Is it a good practice to create a ClassCollection of another Class?

Lets says I have a Carclass: public class Car { public string Engine { get; set; } public string Seat { get; set; } public string Tires { get; set; } } Lets say we're making a system ...
8
votes
3answers
355 views

Is a try and catch that does not throw an exception more efficient than a conditional?

I came across this example recently: If 999 times out of 1,000 an exception will not be thrown then the exception is only generated once. On the other hand a conditional would have been called ...
3
votes
3answers
265 views

Simple questions to test understanding of Dependency Inversion Principle

I am preparing a short (1-2 hour) presentation about DIP to several (~5) junior developers (1-3 yr xp) in the office. At the end of the presentation I want to know whether they understood what I was ...
4
votes
6answers
856 views

Is there any difference between interfaces and abstract classes that have abstract methods only?

Let's say we have an abstract class and let this class has only abstract methods. Is this abstract class different from an interface that has same methods only? What I am looking to know is if there ...
0
votes
1answer
130 views

JavaScript static methods retrieval

I have been thinking about it and wanted some feedback, recently I thought about doing it like this: function foo(){ if ( !foo.prototype.statics ){ foo.prototype.statics = { // ...
5
votes
5answers
450 views

Is there any difference between pointers and references? [duplicate]

References and pointers do the same thing as I know. Is there any difference between them? If there is no difference, why we call them reference not pointer?
2
votes
5answers
242 views

Do tools, like Windows Workflow, inhibit development growth? [closed]

I’ve had this gut feeling about Windows Workflow (WW) for a while now. And, until now, I couldn’t think of the right words to say in order to explain it. Since I think I have a good way to verbalize ...
10
votes
3answers
343 views

Dependency Inversion Principle: How to define “high-level policy” and “low-level detail” to other people?

I am trying to explain the dependency inversion principle to my (mostly junior) colleagues. How can we define which one is the "high-level policy" and which one is the "low-level detail" in a ...
0
votes
1answer
109 views

How does dependency inversion principle work in languages without interfaces?

In C#/Java, the dependency inversion principle is often demonstrated by high-level classes that depends on an interface/abstraction (that it owns). Low-level classes will implement the interface, thus ...
0
votes
1answer
176 views

Teaching `class`es and objects in C++ to university students

To learn classes and objects at my university, students are required to develop a simple game (nine-mens morris or something similar) using Java. Java is used because of its libraries and tool ...
6
votes
3answers
903 views

Why do some of object oriented languages let programmer use primitive types?

Why do some object oriented languages let the programmer use primitive data types? Aren't classes like Integer, Boolean, etc. enough?
8
votes
6answers
918 views

Should my code be DRY or readable if it can't be both?

I'm writing Ruby code for a simple encryption exercise and have frequently run across this dilemma (the exercise is a solitaire cipher if you must know). It is a question of whether I should pad out ...
2
votes
3answers
166 views

Factory Method: does the Product have to be a different class than the Creator?

I want to build three sites in PHP. I'm doing this as slowly, thoughtfully and carefully as I can, to learn as much about things like OOP and software architecture as possible. From past experience I ...
-1
votes
4answers
209 views

Immutable vs mutable object as returned parameter for class method [closed]

There is a class method (static method) in which I create and build some object. And for filling that object, I create it as mutable object. My mutable object is a subclass of immutable object. So ...
2
votes
2answers
201 views

Writing OOPS code in Non Object Oriented Language

I was reading some article on the internet as I was preparing for interview and I found out below statement- Writing object oriented code, even in non-object oriented language? Is this statement ...
10
votes
3answers
917 views

“Too object-oriented”

I come from a strong OO background, and I have recently started working in an organization which, although the code is written in Java, has a lot less emphasis on good OO design than what I am used ...
4
votes
3answers
312 views

Is it acceptable for child classes to “break” parent class functionality?

One of the devs that works with me is following the Open/Closed Principle to add functionality to a Model by extending from our framework ORM. class BaseModel extends ORM { ... } All our models ...
3
votes
2answers
154 views

java classes and database queries

Can someone please explain the best way to solve this problem. Suppose I have three classes Person Venue Vehicle I have a DAO method that needs to return some or all of these attributes from each ...
2
votes
2answers
185 views

What is a Service Locator?

I've heard the term pop all around. I've read various articles regarding the subject and heard two main definitions to the term "Service Location": A glorified Registry - Bad practice, global ...
3
votes
1answer
104 views

The Service class in MVC

From time to time I find there is a need to build a service class. Something I can't really attach inside a model in order to respected GRASP and SOLID. So I created a class called ...
1
vote
3answers
224 views

Should methods always be closed for modification?

Say I have a method called 'functionA' that is called by a service and carries out a single piece of functionality, it is easy to unit test as it is does one thing only. If a few months later an new ...
-1
votes
1answer
90 views

Best way to build a hierarchy CLI menu?

I want to build a command line interface with menus and sub-menus and eventually the leafs of the tree should be operations like.. bank management -> account management -> add acount (insert account ...
0
votes
2answers
119 views

What is a good technique to prevent unauthenticated users from accessing controller methods?

I have an event(s) controller: class Event extends CI_Controller{ public function index(){ } public function foo(){ } //Shouldn't be able to use this method unless logged in ...
3
votes
3answers
177 views

What is a static method compared to instance/class/private/public methods?

I'm learning programming in Objective-C and I can't understand what a static method is. I know what class/instance/private/public methods are. Can someone explain what it is using an example and ...

1 2 3 4 5 15