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)

12
votes
4answers
955 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
356 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 ...
84
votes
17answers
70k 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
150 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
32k 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 ...
2
votes
3answers
2k views

Objective-C As A First OOP Language? [closed]

I am just finishing the second semester of my CS degree. So far I learned C, all the fundamental algorithms and data structures (e.g., searching, sorting, linked lists, heaps, hash tables, trees, ...
35
votes
2answers
7k views

Does the ActiveRecord pattern follow/encourage the SOLID design principles?

I'm interested in whether ActiveRecord pattern, made famous from Ruby on Rails, encourages or discourages the use of SOLID design principles. For example, it seems to me that ActiveRecord objects ...
18
votes
5answers
8k views

Using static classes as namespaces

I have seen other developers using static classes as namespaces public static class CategoryA { public class Item1 { public void DoSomething() { } } public class Item2 { ...
2
votes
1answer
741 views

design of 'game engine' for small javascript games?

I'm making a group of two or three simple javascript games for fun. After someone finishes one game, they'll be presented with a harder or easier version of another game depending on whether the ...
4
votes
2answers
707 views

Age of Design Patterns

When did these design patterns originate? Balking, Builder, Delegation, Facade, Memento. I have looked for days across the net, so if someone points me to a simple google search I may shoot myself. ...
26
votes
10answers
4k views

How many are too many interfaces on a class? [closed]

I would probably consider it a code smell or even an anti-pattern to have a class that implements 23 interfaces. If it is indeed an anti-pattern, what would you call it? Or is it simply just not ...
0
votes
2answers
298 views

Inheritance versus Composition in a business application

I have a training management and tracking system, with a high level structure as follows: We have a Role1, e.g. Manager, Shift-boss, miner, etc. and a Candidate, training for that Role. The role has ...
3
votes
3answers
277 views

May I give a single class multiple responsibilities if only one will ever be reusable?

To the extent that I understand the Single Responsibility Principle, a SINGLE class must only have one responsibility. We use this so that we can reuse other functionalities in other classes and not ...
6
votes
2answers
280 views

Should ActiveRecord-based domain models have visible properties? Why or why not?

Should ActiveRecord-based domain models have visible properties? Why or why not? My experience and studies have always lead me to believe that object properties should always be protected, and that ...
11
votes
4answers
13k views

Example of where Functional Programming is Superior to Imperative or Object-Oriented Programming? [duplicate]

Possible Duplicate: Which problems domains are more suited to functional programming solutions I've been reading about functional programming. I've been using mostly C#.net recently, and I ...
12
votes
2answers
1k views

Is my description of the actor model right?

If I understood, the actor model is just like the object model, but with a few differences: EVERY object spawns it's own separate thread and its not a problem even when you have thousands of objects....
6
votes
1answer
984 views

Delegation and MetaClass in C++

We have an OOP course at our university, while discussing the concepts I came across MetaClass and Delegation. As far as I know, these don't exist in C++. Could someone give an example by which I can ...
6
votes
5answers
1k views

Is object oriented really good for kids? [closed]

I read, that Smalltalk was designed for kids or for education. So was it good at it? Better than the other languages? Was it good/easy also for average kid (I read that bright kids enjoyed). Is there ...
6
votes
11answers
1k views

What language should be used to teach object-oriented design and development in university? [closed]

My understanding is that C++ is usually offered as the 1st OOP language, and as the 2nd programming language (after C) in my country (Bangladesh). I've taught it several times, and the problem I've ...
9
votes
4answers
432 views

Should the creation of an object implicitly or explicitly create a file?

I'm creating an object whose sole purpose is to read in a file of one format and create another of a different format. Is it best to create the output file implicitly during object initialization or ...
1
vote
3answers
4k views

How to apply good Object Oriented Design principles in Embedded Systems [closed]

I am a firmware engineer moved from Electrical background to Embedded Systems. I was till now programming in C and never bothered to apply OO principles in my design. Recently I was forced to ...
4
votes
2answers
613 views

Is it poor technique to have functions within a class depend on one another in a “cascade” type fashion?

I am fairly new to PHP and OOP. Having said that, I wanted to know how independent functions should be within a class. I know that each function should be responsible for doing just one thing. ...
10
votes
3answers
2k views

What are the typical naming conventions for OO C public and private functions? [closed]

Short Question Is there a typical way to name 'public' and 'private' members of an OO C project? Background I fully understand that public and private members do not really exist in the C language. ...
42
votes
8answers
4k views

Do object-oriented programming languages exist that are not class-based?

Are there any object-oriented programming languages that are not based on the class paradigm?
13
votes
4answers
2k views

How much design to do first? [duplicate]

I have never worked with a professional software development team. As such, analyzing and thinking about each and every aspect of my software does not come naturally to me. Whenever I strike an idea ...
2
votes
3answers
620 views

Which is most important to learn OOP first or to learn the OOP language you want to learn? [closed]

I face a problem nowadays, I have a really good book that explain OOP but it uses a language which I do not want to learn which is Java because my goal is to learn C#. And I don't know if I should ...
6
votes
4answers
453 views

Which popular object-oriented languages support readonly methods?

I thought that many object-oriented languages have a reserved keyword for methods which do not modify the state of an object. These methods often have names that start with get. AFAIK a "getter" is ...
75
votes
11answers
26k views

Why is C not considered an 'object-oriented' language?

It seems that C has its own quasi-objects such as 'structs' that can be considered as objects (in the high-level way that we would normally think). And also, C files themselves are basically separate ...
0
votes
1answer
100 views

How to link classes in different packages (on different pages)?

Extending the answer to this question, I have broken down a large system into a few classes per package. Each package is now shown in a different page for readability, but now how do I show the ...
33
votes
1answer
968 views

What's a generic word for both Methods and Attributes?

In a class diagram, each class contains methods and attributes. What's the correct word for describing both of them besides something generic such as contents or items? Context: The Orange class ...
2
votes
3answers
701 views

Designing an easily extensible XML driven OOP system

I've been working on a project that is very data-driven (a checkers board game with customizable rules; I'm using XML for the data storage). I need a design that is easy to extend as we add new ...
10
votes
2answers
312 views

is it a reasonable practice to extend a class just to reuse a single function?

I am developing a range of post filters for a wordpress site, and I have built the first 4 with a single class. The final two are different enough in scope to only share a single function (the ...
14
votes
3answers
2k views

Tips/advice on how to reduce the use of “manager” classes?

I sometimes hear that having too many "manager" classes in your program's design is code smell and add an unnecessary layer of complexity. To me it makes sense that people want to use manager classes ...
3
votes
2answers
316 views

Should I use chained functions in Java?

From time to time, I'll have a class in Java that takes a multitude of parameters, however, sometimes when I am creating an object of this class, I don't need to use all the parameters. As of now, I ...
0
votes
2answers
146 views

Is hooking Data access method on wrong object detrimental for a developer

In a simple application I am creating there are Admin and users where admin can create users. Right now I am creating Classes that encapsulate database CRUD calls with methods. For example: ...
3
votes
3answers
340 views

Do simple accessors and mutators benefit from commented block headers?

Short Question Is it necessary to add the function header comments for simple accessors and mutators? Example u8 OBJ_get_state_x(void) {return obj.state_x;} void OBJ_set_state_x(u8 x) {obj....
28
votes
3answers
25k views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
3
votes
1answer
332 views

Do “Builder” static methods violate SOLID?

I am writing a class which consists mostly of data storage responsibilities. The context for the use of this class will, in general, be retrieving an array of objects of this type for display later. ...
36
votes
2answers
9k views

What are the advantages of prototype-based OOP over class-based OOP?

When I first started programming Javascript after primarily dealing with OOP in context of class-based languages, I was left confused as to why prototype-based OOP would ever be preferred to class-...
1
vote
2answers
244 views

What it is a data structure of a certain type called?

I'll try to keep this as much language agnostic as I can but I'll give the examples in C# since I now know how to solve it that language. The question came to mind when I was thinking of how could I ...
4
votes
8answers
1k views

What is the term that describe objects representing both logic and data?

The reason I am asking this question is I want to know how to properly call an architecture where classes have either data or logic but not both. I know this goes against object orientation and ...
14
votes
14answers
8k views

How can I explain the usefulness of Inheritance? [closed]

When trying to explain the concept of Inheritance in OOP, the common example is often the mammals example. IMHO, this is really a bad example, because it will lead the newbies to use this concept the ...
5
votes
5answers
1k views

Proper OO design for State and Command

I'm working (a bit) on a (turn-based strategy) game. There are two classes relevant for the question: State: This is an immutable class, which exposes all its fields (either via getters or another ...
8
votes
2answers
4k views

How to remove duplicate code (in general)?

In an OO language (e.g. but not limited to Java) how do you fix duplicate code depending on the scope of it's occurrence? I would start with (for example) in the same class (scope) perform the ...