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
3answers
173 views

Roadblock-confused about structure of program

I'm new to programming, and I'm working in C. I know that this is structured programming but if I use blocks, say for local variables: { int i; for(i=0; i<25; i++){ printf("testing...\n"); ...
10
votes
4answers
739 views

What's wrong in returning hashtable from public method and when does it make sense to do so?

What are the design problems in returning a hashtable from a public method when you want to return multiple items instead of creating a class and returning object of that? If it does have problems ...
10
votes
7answers
3k views

What are the features required for Object Orientation?

I am just wondering, what exactly are the features a language or a library must provide in order for it to be defined as 'Object Oriented'. Is Object Orientation something that can, more or less, be ...
13
votes
4answers
10k views

How did you get good practices for your OOP designs?

I realized I have a difficulty creating OOP designs. I spent many time deciding if this property is correctly set it to X class. For example, this is a post which has a few days: ...
6
votes
3answers
4k views

Should I use friend classes in C++ to allow access to hidden members?

Here is my situation (a simple example). Say I have a class called HiddenData Then I have another class called StoreHiddenData And finaly a class called OperateHiddenData Here's the thing, my ...
6
votes
4answers
850 views

Object-oriented design question

I am using a class through a dll to which I do not have direct control. So in effect, I am only a client of this class. The class represents a form that can be printed, sent to clients and tracked ...
4
votes
3answers
781 views

Can you point me to a nontrivial strategy pattern implementation? [closed]

We are faced implementing a registration workflow with many branches. There are three main flows which in some conditions lead to one another. Each flow has at least four different steps; some steps ...
17
votes
8answers
23k views

What is the point of an interface? [duplicate]

Possible Duplicate: When to use abstract classes instead of interfaces and extension methods in C#? What other reasons are there to write interfaces rather than abstract classes? This ...
6
votes
3answers
2k views

Various programming concepts (from a Python viewpoint)

Ever since I've started lurking on stackoverflow, I keep coming across programming concepts such as abstract classes, virtual functions, contracts, interfaces, etc., from a questions about other ...
8
votes
9answers
2k views

Should I pass an object into a constructor, or instantiate in class?

Consider these two examples: Passing an object to a constructor class ExampleA { private $config; public function __construct($config) { $this->config = $config; } } $config = new ...
6
votes
4answers
2k views

What is the best way to access multiple child properties?

I have a situation where I have to access several "sub-properties" of an object and find it quite appalling to write such code. I was wondering how best to deal with this situation: void Main() { ...
8
votes
2answers
908 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
146 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
560 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
321 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 ...
9
votes
6answers
11k 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
204 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
501 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
275 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
246 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
142 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 ...
0
votes
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. ...
0
votes
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: ...
10
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 ...
4
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
197 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
764 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
2k 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
517 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
609 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 ...