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
0answers
35 views

How to design socks proxy server (OOP)

I'm working on a socks server application written in C#. But I don't really know how to design this in a nice way. I got this for Socks V4 and V4A: I'm not sure if it clears things up, but I think ...
0
votes
1answer
149 views

How to make C# methods work like javascript functions?

I'll keep it simple, I want to make C#'s methods work like javascript's functions. Mainly so I can convert this - function makeVariable(terp) { var me = {value: 0}; return function () { ...
3
votes
1answer
71 views

Adding field to the class at runtime - design pattern

Imagine your customer want's to have a possibility to add new property (e.g. color) to product in their eshop in their CMS. Instead of having properties as fields: class Car extends Product { ...
0
votes
0answers
102 views

How can I re-use object from another project?

I have a first project has a feature to viewing, inserting and updating an employee record, with this possibly I will create a java class for the UI and another for the database connection with ...
2
votes
3answers
218 views

Inheritance: Is code from superclass virtually *copied* to subclass, or is it *referred-to by subclass*?

Class Sub is a subclass of class Sup. What does that mean practically? Or in other words, what is the practical meaning of "inheritance"? Option 1: The code from Sup is virtually copied to Sub. (as ...
3
votes
1answer
163 views

OO design choice and single responsibility principle

I'm currently refactoring an application which periodically downloads content from various sources (http, ftp, sql, etc). There is a schedule which controls the times during which the application can ...
0
votes
0answers
79 views

How does OOP make the creation of abstraction layers easy? [on hold]

I'm a Java programmer and I would say OOP comes rather naturally to me. I'm not here to learn what OOP is. However, I have very little experience in non-OO imperative programming. So I can't really ...
0
votes
1answer
119 views

Is NoSQL a better choice when working with OOP? [on hold]

This might be a silly question, but I've reading a little bit about NoSQL databases on the past few days and I'm trying to understand when really they help us. One thing I've realized though is that ...
0
votes
0answers
89 views

Implementing a strategy pattern with dependency injection

Okay, so the goal here is to implement a strategy pattern that can be tested using any sort of automated testing tool. I've been struggling with this problem conceptually for a few weeks now and I ...
4
votes
3answers
455 views

What is the process of determining which method in a class hierarchy should execute known as?

I thought I understood inheritance and polymorphism, but I was given this question, and I can't, for the life of me, figure out what the proper answer is or what they're trying to get at: The ...
1
vote
1answer
95 views

Naming convention for subclasses which extend/inherit baseclasses [on hold]

Zend provide a naming convention for Abstract/Interface classes which states you end these classes with the class type respectively. I am curios how to name my sub-classes which extend/implement ...
-3
votes
0answers
21 views

How do you set the text of a label to an array value on Xcode? [on hold]

I would like to set a value of my array to a label. Array declaration: // // ViewController.h // Cornell Notes // #import <UIKit/UIKit.h> @interface ViewController : UIViewController{ ...
1
vote
2answers
120 views

Using the Decorator pattern to add public methods to an object

The Decorator pattern is usually used to extend the functionality of an object by extending one of it's current methods. To illustrate, please consider an object object and a decorator decorator. ...
1
vote
1answer
52 views

Differences between Dynamic Dispatch and Dynamic Binding

I've been looking on Google for a clear diffrentiation with examples but couldn't find any. I'm trying to understand the differences between Dynamic Dispatch and Dynamic Binding in Object Oriented ...
-1
votes
0answers
57 views

Java: Singleton Event Driven Design [on hold]

I have a singleton class ( I make this as immutable ). This class is present in the base module. It has a static method getInstance() which will initialize a new object based on the data stored in a ...
-1
votes
0answers
43 views

Real world example of why OOP is helpful in coding for some projects than procedural language? [duplicate]

I'am a newbie in coding.just learned java,understood OOPS well but how is OOP is better than procedural language for solving problems and coding? Please put a real world example code of same code ...
-2
votes
0answers
54 views

What are the benefits of decoupling the View from the Model? [duplicate]

I have recently learned about the MVC design pattern, and have created a small application implementing it. I've been thinking about the MVC concept and it's benefits, and currently I think that ...
-2
votes
0answers
33 views

Application of Composition Inheritance and Interfaces A Model [closed]

For learing oop I opend a little project by myself. I like rollplaying so I choose to build a character generator. I guess it is quite similar to a online game character generator. I cannot explain ...
-4
votes
3answers
96 views

How to inherit from two parent classes

I have many classes with many relationship I draw Uml that relation between them: Is this relation true and how to implement this?
0
votes
1answer
120 views

Singleton: Why is a global point of access bad? [duplicate]

Most people here and on StackOverflow agree that Singletons are evil. The main explanation I've come across against the use of Singletons, is they fact that they provide a global point of access to ...
-4
votes
0answers
58 views

How to explain Inheritance and Polymorphism to NON CS Students with examples? [closed]

I was wondering if some one could help me with explaining Inheritance and Polymorphism with real world examples to NON CS students preparing for a job interview in a IT firm. PS: My first question on ...
2
votes
2answers
120 views
+100

Refactoring sought for replacing shared data types in .NET component

I am in charge with updating a software product that is made up of two components the Controller process and the UI process. The Controller and the UI communicate via XML messages. Furthermore, the ...
0
votes
1answer
92 views

What is the recommended approach for helper functions in JavaScript?

What is the recommended approach for helper functions? I would like to choose one technique, and run with it to create my new "class". Here are the design options I have pondered: Option 1: Helper ...
-2
votes
0answers
39 views

How substantial is the overhead of using OOP with PHP? [closed]

I've heard it said that the overhead of using OOP with PHP (being an interpreted language) caused a project to fail. The project had many tables, many classes, and the interpreted nature of PHP ...
2
votes
3answers
178 views

When to use a Singleton and when to use a static class [duplicate]

I've searched about this here and on StackOverflow and found some differences between the two. But I'm still not sure in what cases one would prefer a Singleton, and in what cases one would choose to ...
1
vote
2answers
79 views

Does subtype polymorphism distinguish between inheriting behavior, or inheriting an interface?

To provide some context, I've seen some comments lately that equate inheriting behavior from a supertype, with inheriting a pure interface with no behavior. But there are pretty significant, and ...
1
vote
2answers
108 views

UML class diagram notations: Differences between Association, Aggregation and Composition

I'm confused about some of the notations of UML class diagrams. Pretty sure I know what Association means. Any relationship between instances of two classes, where an instance of one class needs to ...
2
votes
1answer
115 views

UML class diagrams: How to show dependency

Please consider a program with four classes: Class A, B, C and D. Classes A and B are subclasses of abstract super-class C. Class D is dependent on C. Meaning: It holds a C objectOfTypeC field. As ...
0
votes
1answer
148 views

My UML class diagram is too complicated, what should I do?

Classes have 10-20 links with one another and you can't see anything in that mess of a diagram Unfortunately we finished coding already and if we change the class diagram we have to redo the whole ...
0
votes
1answer
108 views

MVC in a desktop application - can the View ever hold a reference to the Model?

(I'm specifying this is a desktop application so people wouldn't refer specifically to web implementations of MVC). The title says it all pretty much. In an MVC structure - can the View ever hold a ...
0
votes
1answer
41 views

Implementing objects with several equivalent representations

I am wondering if there are patterns, references or useful resources about how to implement objects that may have several equivalent representations. For example: Suppose I want to implement a ...
3
votes
2answers
145 views

MVC design decision: two controllers or two models? [closed]

I'm planning to create a small program for simple encryption and deciphering of text. Both the deciphering mode and the encryption mode use the same GUI. I think an MVC structure would be very ...
3
votes
0answers
182 views

Dependency Inversion Principle: Understanding how both low level components and high level components depend on abstractions

I'm learning about the Dependency Inversion Principle. It states that: High level modules should not depend upon low-level modules. Both should depend upon abstractions. For a while I tried to ...
-1
votes
3answers
158 views

How important is it to learn UML for an OO developer? [closed]

When studying OOP by myself I often encounter UML class diagrams. I understand them, but don't completely know how to write them. Meaning, I don't entirely know what each kind of arrow means, and ...
-2
votes
1answer
43 views

calling an abstract method in abstract class

Suppose i have an abstract base class Parent which defines an abstract Method A(some parameter) taking a parameter, also it defines an instance Method B which calls method A(parameter) inside its ...
8
votes
5answers
717 views

Are there flavours of OOP where some or all of the SOLID principles are antithetical to clean code?

I recently had a discussion with a friend of mine about OOP in video game development. I was explaining the architecture of one of my games which, to my friend's surprise, contained many small ...
4
votes
3answers
278 views

Dependency Inversion Principle vs “Program to an interface, not an implementation”

I'm trying to understand how the Dependency Inversion Principle differs from the "program to an interface, not an implementation" principle. I understand what "Program to an interface, not an ...
2
votes
3answers
178 views

Abstraction concept in OOP

I hear that Abstraction is a technique that helps us identify which specific information should be visible, and which information should be hidden. Encapsulation is then the technique for packaging ...
1
vote
1answer
144 views

Java code quality in methods calling methods

I am currently working with an "interesting" code-base and see the following type of thing alot in the code. public Object doSomething() { Object obj = new Object(); // Do some stuff to the ...
11
votes
2answers
487 views

Are monads a viable (maybe preferable) alternative to inheritance hierarchies?

I'm going to use a language-agnostic description of monads like this, first describing monoids: A monoid is (roughly) a set of functions that take some type as a parameter and return the same ...
57
votes
10answers
5k views

Zero behavior objects in OOP - my design dilemma

The basic idea behind OOP is that data and behavior (upon that data) are inseparable and they are coupled by the idea of an object of a class. Object have data and methods that work with that (and ...
4
votes
3answers
201 views

Classes in OOP , methods and attributes memory internals [closed]

I would assume that instances of the same class would actually share their methods, and just have save different attributes in their namespace. How often do you arbitrary add methods to a single ...
0
votes
1answer
41 views

System Communication: Avoiding Including a Large “HAS-A” Hierarchy Which Isn't Used

The situation: System A Huge, complicated system. Uses an important Message object with many other Message objects attached, many of which have further Message objects attached. In total, this is ...
25
votes
8answers
4k views

Why have private static methods?

I just wanted to clear up a question I have. What is the point of having a private static method as opposed to a normal method with private visibility? I would have thought an advantage to having a ...
1
vote
1answer
150 views

Good pattern(s) for pointing to mutable state

I asked this question once here, but believe the question was unclear. However I'm having a hard time extracting the general problem from my specific case. UPDATE: I've answered my own question ...
47
votes
6answers
4k views

What really is the “business logic”?

I'm working with web development since 2009, when I started with PHP. When I moved to ASP.NET I've heard a lot about DDD and OOAD where a lot of focus is given to this "business logic" and "business ...
-1
votes
2answers
224 views

Utterly Confused with OOP - How do I overcome a beginner's hurdle? [closed]

I have been reading and working through the exercises of Steve Lott's book Building Skills in Python. However, on the very first exercise dealing with OOP I have gotten completely stuck. The problem ...
4
votes
2answers
187 views

What are the advantages of strictly maintaining separate data | algorithm | interface layers?

I always separate the user interface from other functionality in my programs - its the way I have been taught, and it has obvious advantages since you can change the interface but keep the same ...
1
vote
3answers
212 views

Why are inheritance and interfaces restricted to instance members?

Disclaimer: I think the rules are almost the same in most OO languages, but since I'm most familiar with C# I'll be relating to this specific language. I think that the use of attributes and ...
0
votes
2answers
86 views

Name for use of methods that return rather than set

There exists a general OOP principle that methods should return local variables rather than set object fields. For instance, say I have the following piece of code (example in Java): public class ...