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)

8
votes
2answers
932 views

What is the name for the programming paradigm characterized by Go?

I'm intrigued by the way Go abandons class hierarchies and seems to completely abandon the notion of class in the typical object oriented sense. Also, I'm amazed at the way interfaces can be defined ...
7
votes
1answer
147 views

Private interfaces within a package

This is basically the same as Coding to interfaces, but played out in the real world of com when there are various engineering complexities such as immutability of published interfaces and ...
26
votes
10answers
3k views

How would Functional Programming proponents answer this statement in Code Complete?

On page 839 of the second edition, Steve McConnell is discussing all the ways that programmers can "conquer complexity" in big programs. His tips culminate with this statement: "Object-oriented ...
2
votes
2answers
135 views

Would be semantically correct to make a “Login” constructor in an api class?

Since the methods of the class will only work if the user is logged in, is it right or is there some problem that might make my code slow/inneficient?
5
votes
5answers
1k views

Object oriented programming concepts

Specifically, programming without inheritance is distinctly not object-oriented; we call it programming with abstract data types. I found this great line from Grady Booch's "Object-Oriented ...
4
votes
7answers
565 views

Employer appeal; OOP use in mainstream; solutions that blossom with OOP

I'm currently in the process of what I hope to be a career change into the programming field. Despite my wide range of knowledge in the field and additional exposure to concepts in college (which in ...
3
votes
4answers
2k views

OOP - How to handle multiple instances of a class

In OO programming, what's the preferred way of handling multiple instances (objects) of a single class? Say you want to write a program where a random number of circles get drawn on screen, where ...
3
votes
4answers
2k views

Can you call any php model class in an MVC from the controller?

I'm creating a simple MVC at the moment and am wondering if it's 'correct' to be able to call any model class directly from the controller to get the data to send to the view? I have the following ...
2
votes
3answers
323 views

Basis of definitions

Let us suppose we have a set of functions which characterise something: in the OO world methods characterising a type. In mathematics these are propositions and we have two kinds: axioms and lemmas. ...
2
votes
2answers
395 views

Is there a better way to design these classes?

I have two business classes: TimesheetDay and TimeSlot. One TimesheetDay can have one or more TimeSlots. The TimesheetDay and TimeSlot classes will be dependent on an object that implements a ...
4
votes
1answer
183 views

How often is appropriate to destroy objects?

I know this is hard to answer without examples, so I'm looking for general principles or guidelines here. I'm thinking within the realm of small- to medium-sized mobile games and apps. I've read a ...
10
votes
6answers
14k views

Can we say objects have attributes, states and behaviors?

I was reading through Oracle's introduction to OOP concepts and I came across this description: Real-world objects share two characteristics: They all have state and behavior. Dogs have state (...
13
votes
7answers
1k views

How do you keep track of large projects?

When dealing with a project that has many different files, I always seem to loose track of how the parts interact with one another. I've never really had much of a problem understanding smaller ...
6
votes
6answers
1k views

Organizing Class Members in Regards to Access Modifier

If we look at typical implementation of a Class, we usually see the private members defined at the beginning and public( mostly functions and Accessors) defined towards the bottom. Now, is this a ...
4
votes
4answers
3k views

Is this the correct approach to an OOP design structure in php?

I'm converting a procedural based site to an OOP design to allow more easily manageable code in the future and so far have created the following structure: /classes /templates index.php With these ...
6
votes
4answers
205 views

Are there any languages that allow the static context of a method call to be available at runtime?

Is it possible for a method to know the type of the method it is called under? So for example in the following object orientated psuedo code: Instance io = new InstanceSubclass(); io.doStuff(); Is ...
5
votes
3answers
514 views

Naming conventions for the only envisioned implementation of an interface [closed]

If you decide "Program to An Interface" trumps YAGNI and decide to create a supertype where you don't envision anything other than one obvious implementation - is there a convention for naming the ...
5
votes
6answers
1k views

Can you learn OO programming without procedural?

I've seen a number of question asking whether someone should learn procedural or OO first. But is this even possible? Can you learn OO programming without first having an understanding of procedural ...
3
votes
1answer
283 views

Strategies for counting child objects

What is an efficient, OOP way to count child records of an object? In my current project, a District may contain zero or more School records. The Districts object acts as a collection of District, ...
1
vote
2answers
1k views

Implications of handles between forms

I was developing a WindowsForm application in C#, with 2 forms. Regardless of what they both did specifically I needed to access values in form2 and send them to form1 and vice versa. For this to ...
0
votes
1answer
248 views

What do I need to include in my OOP design document?

I am a graduate student in aerospace engineering. A lot of my Master's thesis has been on developing an OOP software architecture in MATLAB to facilitate control of Arduino-based vehicles (blimps, ...
3
votes
3answers
2k views

What's an Elegant and OOP way to create a tree from arrays and render it as a nested UL

I have a series of arrays which represent file system paths, so each next value is actually a directory deeper, for example: var a1 = ["Desktop", "Pictures", "Summer 2011"]; is the equivalent of ...
1
vote
3answers
129 views

Encapsulating a single property

If you have a single property that is relevant across a full project, but you should logically have only a single representation of, how would you represent this? In my case, I am developing a simple ...
2
votes
2answers
146 views

Pattern for user interaction and confirmation

Suppose a FileWriter class that needs validation that it will not erase a file already present, if one is found. It would have two functions: public bool FileExists(string filePath) //... public bool ...
1
vote
1answer
5k views

What are C's advantages over OOP languages, other than performance? [duplicate]

Possible Duplicate: When to use C over C++, and C++ over C? C still has its own importance in the programming world! And one reason for it is its performance. But, I have some questions. Is ...
1
vote
2answers
2k views

Translating between Python-Django and Javascript

I have a conceptual question about 'translating' between objects I have stored in Django (in Postgres) that I want to use on the front-end. So I have a user object in Python that holds basic things: ...
11
votes
10answers
5k views

Does object-orientation really affect algorithm performance?

Object orientation has helped me a lot in implementing many algorithms. However, object-oriented languages sometimes guide you in "straightforward" approach and I doubt if this approach is always a ...
5
votes
1answer
3k views

Non-OOP languages advantages and good uses

I'm a C# developer, but I also know Java, JavaScript, XSLT, a little of C and Perl, e some other that I may have forgotten. Still, the paradigm I'm most familiar to is OOP. I have always thought ...
8
votes
3answers
1k views

Does command/query separation apply to a method that creates an object and returns its ID?

Let's pretend we have a service that calls a business process. This process will call on the data layer to create an object of type A in the database. Afterwards we need to call again on another ...
0
votes
3answers
201 views

What to search/research to learn more about this way of coding Java?

What should I search/research if I'm looking for how to get started with translating database tables to Java code? For instance, if I have a one-many relationship in the database and I want to ...
3
votes
2answers
4k views

What are the pros and cons of multiple inheritance? [closed]

What are the consequences of allowing multiple inheritance in a programming language? Why does multiple inheritance tend to violate the very essence of OOP? Is that what differentiates a pure OOP ...
7
votes
5answers
2k views

OOP private method parameters coding style

After coding for many years as a solo programmer, I have come to feel that most of the time there are many benefits to write private member functions with all of the used member variables included in ...
31
votes
18answers
6k views

What would you do if your client required you not to use object-oriented programming?

I am writing a program to simulate the activity of ants in a grid (PDF). The ant can move around, pick up things and drop things. The problem is while the action of the ants and the positions of each ...
1
vote
1answer
792 views

Can the Abstract Factory pattern be considered as a case of polymorphism?

I was looking for a pattern/solution that allows me call a method as a runtime exception in a group of different methods without using Reflection. I've recently become aware of the Abstract Factory ...
2
votes
3answers
3k views

Object-Oriented Operating System

As I thought about writing an operating system, I came across a point that I really couldn't figure out on my own: Can an operating system truly be written in an Object-Oriented Programming (OOP) ...
0
votes
3answers
1k views

Avoiding coupling

It is also true that a system may become so coupled, where each class is dependent on other classes that depend on other classes, that it is no longer possible to make a change in one place ...
14
votes
5answers
2k views

Is duck typing a subset of polymorphism

From Polymorphism on WIkipedia In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. From duck ...
5
votes
3answers
531 views

Architecture Question

I am writing a rules/eligibility Module. I have 2 sets of data, one is the customer data and the other is the customer products data. Customer data to Customer products data is one to many. Now I ...
2
votes
6answers
638 views

What is the best design decision approach?

I have two classes (named MyFoo1 and MyFoo2) that share some common functionality. So far, it does not seem like I need any polymorphic inheritance but, at this point, I am considering the following ...
12
votes
4answers
979 views

Avoiding bloated Domain Objects

We're trying to move data from our bloated Service layer into our Domain layer using a DDD approach. We currently have a lot of business logic in our services, which is spread out all over the place ...
7
votes
6answers
2k views

A programming language that does not allow IO. Haskell is not a pure language

Are there any 100% pure languages (as I describe in the Stack Overflow post) out there already and if so, could they feasibly be used to actually do stuff? i.e. do they have an implementation? I'm not ...
4
votes
3answers
357 views

Which of these algorithms is best for my goal?

I have created a program that restricts the mouse to a certain region based on a black/white bitmap. The program is 100% functional as-is, but uses an inaccurate, albeit fast, algorithm for ...
10
votes
6answers
6k views

Are Get-Set methods a violation of Encapsulation? [duplicate]

Possible Duplicate: When are Getters and Setters Justified In an Object oriented framework, one believes there must be strict encapsulation. Hence, internal variables are not to be exposed to ...
20
votes
4answers
4k views

How to drastically improve code coverage?

I'm tasked with getting a legacy application under unit test. First some background about the application: It's a 600k LOC Java RCP code base with these major problems massive code duplication no ...
5
votes
4answers
2k views

Why are public and private accessors considered good practice? [duplicate]

Possible Duplicate: When are Getters and Setters Justified Why exactly is having public and private accessors like these: private string foo; public string Foo { get { return ...
87
votes
17answers
73k views

Is it better to return NULL or empty values from functions/methods where the return value is not present?

I am looking for a recommendation here. I am struggling with whether it is better to return NULL or an empty value from a method when the return value is not present or cannot be determined. Take ...
44
votes
8answers
15k views

Is ORM an Anti-Pattern? [closed]

I had a very stimulating and interessting discussion with a colleague about ORM and its pros and cons. In my opinion, an ORM is useful only in the rarest cases. At least in my experience. But I don't ...
2
votes
1answer
155 views

Big table with referential integrity or field typification?

I'm using an ORM (Propel) and PHP to create Objects and store them in a database. So, I'm facing a recurrent problem and I'm pretty sure this happened to someone before. My data model looks something ...
63
votes
13answers
33k views

What's the benefit of object-oriented programming over procedural programming?

I'm trying to understand the difference between procedural languages like C and object-oriented languages like C++. I've never used C++, but I've been discussing with my friends on how to ...
2
votes
6answers
1k views

Is there an alternative to the term “calling object”?

Let's suppose you've got a class defined (in pseudocode): class Puppy { // ... string sound = "Rawr!"; void bark() { print(sound); } } And say, given a Puppy instance, you ...