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)

-1
votes
2answers
935 views

The difference between waterfall model and object oriented model? [closed]

Please explain the difference between the waterfall model and the object oriented model. Since the books and web sites that I've seen didn't provide much information about it, I need someone to ...
2
votes
2answers
445 views

Code Reuse and Abstraction in FP vs OOP [closed]

I've been told that code reuse and abstraction in OOP is far more difficult to do than it is in FP, and that all the claims that have been made about Object Orientedness (for lack of a better term) ...
1
vote
3answers
292 views

Better solution then simple factory method when concrete implementations have different attributes

abstract class Animal { function eat() {..} function sleep() {..} function isSmart() } class Dog extends Animal { public $blnCanBark; function isSmart() { return $this->blnCanBark; ...
0
votes
1answer
106 views

Share Mulitple Classes as one dll or a lib with Mulitple Projects

Currently I have some shared class files(.cpp and .h) which I include them in around 20 Projects. Currently I have to include them in all of the projects. So if I get some business requirments and I ...
24
votes
1answer
2k views

Why is an anemic domain model considered bad in C#/OOP, but very important in F#/FP?

In a blog post on F# for fun and profit, it says: In a functional design, it is very important to separate behavior from data. The data types are simple and "dumb". And then separately, you ...
5
votes
2answers
324 views

Structuring Access Control In Hierarchical Object Graph

I have a Folder entity that can be Moderated by users. Folders can contain other folders. So I may have a structure like this: Folder 1 Folder 2 Folder 3 Folder 4 I have to ...
2
votes
3answers
689 views

what's a good approach to working with multiple databases?

I'm working on a project that has its own database call it InternalDb, but also it queries two other databases, call them ExternalDb1 and ExternalDb2. Both ExternalDb1 and ExternalDb2 are actually ...
5
votes
5answers
305 views

How to organise OO code [duplicate]

If you have a method that doesn't need access to any non public fields, properties or methods where should you put the method ? should it just be a normal method in the class, a static method that ...
2
votes
3answers
379 views

Recommened design pattern to handle multiple compression algorithms for a class hierarchy

For all you OOD experts. What would be the recommended way to model the following scenario? I have a certain class hierarchy similar to the following one: class Base { ... } class Derived1 : ...
7
votes
1answer
365 views

What are some techniques I can use to refactor Object Oriented code into Functional code?

I've spent about 20-40 hours developing part of a game using JavaScript and HTML5 canvas. When I started I had no idea what I was doing. So it started as a proof of concept and is coming along ...
1
vote
2answers
246 views

Go with an object-oriented perspective [duplicate]

My OOP JavaScript question is at the very bottom if you want to skip my introduction. In an answer to the question Accessing variables from other functions without using global variables, there's a ...
5
votes
3answers
456 views

OO - are large classes acceptable? [duplicate]

Despite many years in IT, I still struggle with OO design. One particular problem I seem to keep ending up with is large classes, often containing many hundreds of lines of code. The OO world talks a ...
1
vote
1answer
157 views

How do I create a mutually-incompatible type library in Java?

Folks, this seems like it should be straightforward, but I'm drawing a blank here. As a simplified example, consider an abstract class called Number with an abstract method add(). I want to create ...
3
votes
2answers
195 views

Dependency properties outside the realm of WPF?

Is there a more general concept or name for what WPF calls "dependency properties"? I imagine this is not a WPF-ism and in fact other libraries or frameworks have employed a similar approach? If so, ...
2
votes
2answers
469 views

Is it a Single Responsibility Principle violation?

I'm designing an OO graph library and at the moment I'm trying to figure out the design for a GraphEdge class. I've added setters and getters for it's nodes, direction and weight. This seemes ...
1
vote
1answer
141 views

Design pattern for complex view creation in sheet music

I've got a bunch of Note-Models with properties like pitchand duration. In music notation, these notes must now be placed into a certain bar on a certain line on a certain page, and so on. Many more ...
-1
votes
1answer
361 views

How to reconstruct this application using design pattern

I am engaging in redesigning a linux c++ server application. The application acts as file relayer in the form of receiving file packets (incuding control packets and data packets) from client A, ...
3
votes
3answers
143 views

Representational Equality versus Value Equality

I am coding a system where I have objects which represent a set of resources. These resources are identifiable (they have an ID). There can only be one resource with the same ID, and so multiple ...
3
votes
3answers
130 views

Perform operations in the entry-script, or create a class which just instantiates and calls methods?

I'm building a perl application which does the following operations: Copy a bunch of files (class fileFetcher ) Parse each file (class fileParser) Store some data from each file in a database (class ...
4
votes
1answer
717 views

Getting rid of Massive View Controller in iOS?

I had a discussion with my colleague about the following problem. We have an application where we need filtering functionality. On any main screen within the upper navigation bar, there is a button ...
3
votes
1answer
288 views

How come javascript, being a prototype based language, doesn't have an easy way to access the prototype?

May be this is a stupid question, but I'm kind of intrigued. Being JavaScript a prototype based language, with its pseudo-class function constructors sort of half baked (remember JavaScript: The Good ...
1
vote
1answer
73 views

Variable type object

Is there a language with something like the following construct? var_type(TYPE_1, TYPE_2,..., TYPE_N) obj; and now its possible to: TYPE_17 staticTypeVariable17; obj = staticTypeVariable17; ...
0
votes
2answers
354 views

Separation of Concerns, Data Access Layer

I was thinking about this earlier today and figured I would get some input on the matter. When I develop applications I would usually have the Data Access Layer on another project, incase it could be ...
1
vote
1answer
142 views

Design for migrating to Multitenant architecture

We are in a process of redesigning our product code in such a way so as to support multitenancy. Currently the implementation is such that one product deployment caters to only one customer. Thus ...
4
votes
1answer
226 views

OOP Design - Possible wrong approach makes it impossible to implement it in code

This last semester i've had lectures about OOP design, i understood most of what i was supposed to but there is something that i can't get right. I'm pretty sure that the models i create are wrong ...
1
vote
1answer
70 views

IXRepository and test problems

Recently had a doubt about how and where to test repository methods. Let the following situation: I have an interface IRepository like this: public interface IRepository<T> where T: class, ...
1
vote
4answers
2k views

Keeping track of all objects of a class

I'm new to object-oriented programming, and I keep running into this issue. (I'm programming in Java) I've been a bit reluctant to ask about this, since it seems like such a basic issue, but I can't ...
2
votes
5answers
444 views

OOP concept: is it possible to update the class of an instantiated object?

I am trying to write a simple program that should allow a user to save and display sets of heterogeneous, but somehow related data. For clarity sake, I will use a representative example of vehicles. ...
4
votes
2answers
254 views

Dividing monopoly streets in groups

I'm new to object-oriented programming, to java, and to programming in general, and as my first real project I'm trying to program the board game Monopoly. What I've got so far is an array that can ...
3
votes
2answers
480 views

Extend the class or create an instance?

I'm reading Pro PHP and jQuery and want to rebuild the example. The author is creating a database connection class: class DB_Connect { protected $db; protected function __construct($dbo = NULL){ ...
19
votes
4answers
1k views

How do purely functional languages handle modularity?

I come from an object oriented background where I've learned that classes are or at least can be used to make a layer of abstraction that allows for easy recycling of code which can then either be ...
5
votes
1answer
182 views

How Do You Organize Your Methods in OO Progamming [duplicate]

Whenever I am programming in an object-oriented language, I am always faced with what order and how to group the methods for an object. Are there any standards for this, or any suggestions?
2
votes
1answer
139 views

Is every object rounded to the same size in Java?

According to this answer every object in Java is of the same size? Is the answer talking about the object itself or the reference to the object? Here's the statement: every object size is rounded ...
4
votes
5answers
1k views

Tic tac toe class diagram

I'm in a software engineering class and I want to practice some skills on the most basic case possible : tic tac toe. I know this is overkill but I want to do it in "proper" OOP. I designed a class ...
2
votes
1answer
210 views

Aren't structured programming and object oriented programming complementary?

It seems there is a lot of discussion on the web about the differences between these two paradigms, and how OOP is somewhat better than structured programming. But aren't they complementary? From my ...
4
votes
5answers
320 views

How does the concept of a class change when passing data to the constructor instead of method parameters?

Let's say we're making a parser. One implementation could be: public sealed class Parser1 { public string Parse(string text) { ... } } Or we could pass the text to the ...
1
vote
3answers
181 views

Which closely represents Aggregation?

I know Aggregation is a has-a relationship, but I encountered a question in a test which did not make sense (and had grammatical mistakes as well) Which of the following statements correctly describe ...
0
votes
2answers
2k views

What is a Package Diagram? and What is a Sequence Diagram? [closed]

In many interviews I've been asked this question. What is a Package Diagram? and What is a Sequence Diagram? and difference between Package Diagram and Sequence Diagram. Thanks in Advance. Edit ...
7
votes
1answer
457 views

Object oriented vs vector based programming

I am torn between object oriented and vector based design. I love the abilities, structure and safety that objects give to the whole architecture. But at the same time, speed is very important to me, ...
0
votes
2answers
222 views

Is it useful to use encapsulation in dynamic typed, interpreted programming language?

For what I know, encapsulation is useful because: if you use directly an attribute and change its type in a static typed language you have to change all the code that uses the class. On the ...
0
votes
1answer
179 views

How to store an object state/data for later processing?

What do you think would be the most effective solution to maintain an object status through a life cycle? The goal to be able to be continue from any state any time. During the life cycle likely to ...
4
votes
1answer
314 views

Java language constructs to enforce design decisions

What constructs in OOP languages (specifically Java) allow you to enforce design decisions and intent? I think some examples would be the 'final' keyword, access modifiers, template methods, perhaps ...
2
votes
3answers
1k views

What does 'enumerable' mean?

My background in mathematics is very poor (i.e. last relevant math class taken was high school Trigonometry two years ago - another story for another time). I'm reading 'Javascript: The Definitive ...
1
vote
2answers
109 views

When to store values in constants/finals

This might seem like an odd question, but I'm worried that I'm putting too many things as constants/finals at the top of my java class. I've started to put every value that is in my program into a ...
13
votes
3answers
1k views

Is there a specific name for the “Square inherits from Rectangle” paradox?

A certain failure of OOP is shown with a class Square inheriting from Rectangle, where logically Square is a specialization of Rectangle and should therefore inherit from it, but everything falls ...
0
votes
3answers
172 views

What concept am I missing with private methods and testing? [duplicate]

I've read a lot o blogs arguing about private methods and testing. Some people say you should not test private methods, they say you should make them public or put those methods in a new class. But ...
6
votes
2answers
436 views

Is it good to have an interface plenty of methods which belong to different concepts, just to preserve the Liskov's Principle?

I'm currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario: Scenario Imagine ...
2
votes
1answer
99 views

Run Time Type Identification using Composition

It is said that programmers should prefer composition over inheritance. I was wondering if RTTI can be achieved as easily using composition.
7
votes
2answers
528 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 ...
-1
votes
2answers
849 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 ...