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)

32
votes
2answers
6k 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 ...
15
votes
4answers
6k 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
665 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
618 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. ...
23
votes
10answers
3k views

How many are too many interfaces on a class?

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
283 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 ...
2
votes
3answers
257 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
276 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
9k 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 ...
10
votes
2answers
924 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 ...
6
votes
1answer
847 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 ...
7
votes
11answers
1k views

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

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 ...
8
votes
3answers
303 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
3k 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
492 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?

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
3k 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?
12
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
573 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
452 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 ...
63
votes
11answers
16k 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 ...
-5
votes
4answers
2k views

What is Interface in Java programming language? [duplicate]

Last week my lecturer was teaching us about interfaces in Java. However, I failed to understand her explanation that well. Does anyone have a good description, or explanation of Java interfaces, and ...
0
votes
1answer
89 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
960 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 ...
1
vote
3answers
585 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
305 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 ...
12
votes
3answers
1k 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
307 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
141 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
327 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) ...
22
votes
3answers
17k 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
308 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. ...
27
votes
2answers
6k 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 ...
1
vote
2answers
237 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
7k 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 ...
4
votes
5answers
694 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 ...
7
votes
2answers
2k 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 ...
6
votes
4answers
237 views

Injecting properties/settings into an application

In applications that I write at work, I often need to have an external properties/settings file so that certain parameters can be configurable after the application is deployed with the end-user. The ...
6
votes
8answers
3k views

Which is best programming style to start learning to programm POP or OOP? [closed]

If somebody has to start learning to program, where should he/she start? Should he start to write procedure-oriented programs or jump to OOP?
11
votes
4answers
17k views

In simple words what are are the purposes of abstract classes and/or interfaces? [duplicate]

I have to explain to some students the use of abstract classes and interfaces, as I have a very tecnical background, I would like to know if you would help me to define an easy explanation for junior. ...
8
votes
8answers
3k views

C++ to friend or not to friend

I have an object oriented programming with c++ course this semester at college and we were learning about friend functions. I instinctively dislike them for their ability to bypass the security that ...
9
votes
3answers
845 views

What is the object-oriented thought process? [closed]

I've been studying OOP in conjunction with Zend's MVC implementation for the past few months. I'm pretty new to programming, generally, but I feel strongly that I should learn things the 'right' way, ...
10
votes
3answers
2k views

Applying SOLID principles

I am quite new to the S.O.L.I.D. design principles. I understand their cause and benefits, but yet i fail to apply them to a smaller project which I want to refactor as a practical exercise to use the ...
6
votes
4answers
919 views

Why were concepts (generic programming) conceived when we already had classes and interfaces?

Also on stackoverflow.com: I understand that STL concepts had to exist, and that it would be silly to call them "classes" or "interfaces" when in fact they're only documented (human) concepts and ...
5
votes
1answer
975 views

Object oriented EDI handling in PHP

I'm currently starting a new sub project where I will: Retrieve the order information from our mainframe Save the order information to our web-apps' database Send the order as EDI (either D01b or ...
5
votes
1answer
2k views

Is functional decomposition really an antipattern?

While I was reading The worst anti-patterns you have came across, I clicked on the link in this post to land on the web site about anti-patterns. And the ...
2
votes
2answers
140 views

Where does “isolating complexities” lie in the realm of design principles?

I was just curious, it's something I think most people are aware of as a technique: You have some abominable data that simply must be parsed and you can do nothing to simplify the algorithm for doing ...
2
votes
1answer
247 views

How to best annotate MVC custom action filters?

As I get deeper into the area of ASP.NET MVC 3, I feel like I'm finding a lot of very nice technical nuggets as well as new ways of doing things versus classic ASP.NET. One of those "nuggets" is ...