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)

2
votes
1answer
118 views

Aren't decorators easily breaking the ISP?

"The Interface-segregation principle (ISP) states that no client should be forced to depend on methods it does not use." The decorator pattern is a design pattern to decorate a method of a class. For ...
0
votes
0answers
20 views

Modelling network and persistent entity representations

I have an app where I need to synchronize some entities (simply download latest versions of entities from server to client). Entity has bunch of text properties and bunch of resource links (referenced ...
0
votes
0answers
15 views

Class/Object with different sets of configurations, singletons etc (PHP)

I want to produce maintainable code for configuring one or multiple classes differently depending whether in a production or development environment. For example, making a Paypal class/object that ...
1
vote
1answer
52 views

How to deal with interactions between many objects

I've been working on a game in my spare time. I'm pretty much done defining the primitives and until today everything was pretty well segmented and encapsulated but now it's come time to implement ...
1
vote
5answers
133 views

object model and data model

I have heard/read mixed things on whether to start with an object model or a data model. And more people say to starting with an object model as it will ease your data modelling. My question is, ...
2
votes
2answers
138 views

Is it good practice to declare and set properties in abstract classes?

I am using PHP and designing some abstract classes. I can declare properties with constant values within my abstract class and access/overwrite them from any class which extends this without re ...
-1
votes
0answers
43 views

Functional programming equivalents for the following [duplicate]

I am trying to make the leap from functional programs for "hello world" equivalents to more real-world applications. As I come from a Java world and have been exposed to all it's design patterns, my ...
0
votes
3answers
211 views

Understanding object-oriented programming: why is it important? [duplicate]

Just started learning about classes in C++ and I'm have trouble understanding why object orientated programming (OOP) is useful. I understand the syntax, how to use them etc. But I'm still confused ...
-4
votes
0answers
36 views

About Ruby on Rails [on hold]

I have been working with PHP and Python for a year and now I found Ruby. I suppose PHP didn't help me in my programming language knowledge, but truly did in my skills. In fact, like everyone said, it ...
0
votes
0answers
51 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
181 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
84 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
111 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
234 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
172 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
1answer
125 views

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

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
1answer
139 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
478 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
99 views

Naming convention for subclasses which extend/inherit baseclasses [closed]

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 ...
1
vote
2answers
123 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
45 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
58 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 ...
-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
124 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 ...
2
votes
2answers
130 views

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
94 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
3answers
179 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
82 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
118 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
119 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
153 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
112 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
149 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 ...
4
votes
0answers
191 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
161 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
44 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
724 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
283 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
179 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
145 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
489 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
202 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
151 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 ...
48
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
229 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 ...