Questions tagged [ooad]

Object Oriented Analysis and Design - use this tag for questions related to Object Oriented programming. Also include language tags such as java where appropriate.

Programming paradigm where entities are described as objects with features and capabilities. The main advantage of this approach is the ability to reuse and extend functionality of objects.

See also: Wikipedia entry on OOAD

256 questions
1257
votes
27 answers

When should you use a class vs a struct in C++?

In what scenarios is it better to use a struct vs a class in C++?
Alan Hinchcliffe
  • 12,862
  • 3
  • 18
  • 11
664
votes
16 answers

Difference Between Cohesion and Coupling

What is the difference between cohesion and coupling? How can coupling and cohesion lead to either good or poor software design? What are some examples that outline the difference between the two, and their impact on overall code quality?
JavaUser
  • 25,542
  • 46
  • 113
  • 139
269
votes
15 answers

What is an anti-pattern?

I am studying patterns and anti-patterns. I have a clear idea about patterns, but I don't get anti-patterns. Definitions from the web and Wikipedia confuse me a lot. Can anybody explain to me in simple words what an anti-pattern is? What is the…
g.revolution
  • 11,962
  • 23
  • 81
  • 107
244
votes
18 answers

What does 'low in coupling and high in cohesion' mean

I have problems understanding the statement low in coupling and high in cohesion. I have googled and read a lot about this, but still finding it hard to understand. To what I understand is High cohesion means, that we should have classes that are…
user1315906
  • 3,374
  • 8
  • 30
  • 43
214
votes
10 answers

Constructors vs Factory Methods

When modelling classes, what is the preferred way of initializing: Constructors, or Factory Methods And what would be the considerations for using either of them? In certain situations, I prefer having a factory method which returns null if the…
Hemanshu Bhojak
  • 16,972
  • 16
  • 49
  • 64
188
votes
7 answers

What does "program to interfaces, not implementations" mean?

One stumbles upon this phrase when reading about design patterns. But I don't understand it, could someone explain this for me?
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
185
votes
22 answers

Abstraction VS Information Hiding VS Encapsulation

Can you tell me what is the difference between abstraction and information hiding in software development? I am confused. Abstraction hides detail implementation and information hiding abstracts whole details of something. Update: I found a good…
popopome
  • 12,250
  • 15
  • 44
  • 36
81
votes
12 answers

Why do we use Interface? Is it only for Standardization?

Why do we use Interface? Is it only for Standardization?
Azhar
  • 20,500
  • 38
  • 146
  • 211
76
votes
6 answers

Coupling and cohesion

I'm trying to boil down the concepts of coupling and cohesion to a concise definition. Can someone give me a short and understandable explanation (shorter than the definitions on Wikipedia here and here)? How do they interact? Thanks. Anybody have a…
Jonathan
  • 7,349
  • 5
  • 29
  • 35
31
votes
1 answer

C++ : Association, Aggregation and Composition

I'm beginning to study OOAD and I'm having difficulty finding a C++ code example that'd illustrate how Association, Aggregation and Composition are implemented programmatically. (There are several posts everywhere but they relate to C# or java). I…
Talha5389
  • 738
  • 1
  • 9
  • 22
30
votes
15 answers

How to avoid getters and setters

I have read in many places that "getters and setters are evil". And I understood why so. But I don't know how to avoid them completely. Say Item is a class that has information about item name, qty, price etc... and ItemList is a class, which has a…
Nageswaran
  • 7,481
  • 14
  • 55
  • 74
29
votes
6 answers

How does one elaborate design using CRC cards?

I've always been wondering how people use CRC (class responsiblity collaboration) cards. I've read about them in books, found vague information on the internet, but never grasped it really. I think someone ought to make a youtube video showing a…
Statement
  • 3,888
  • 3
  • 36
  • 45
25
votes
3 answers

Try / Catch in Constructor - Recommended Practice?

Something I've always been curious of public class FileDataValidator { private String[] lineData; public FileDataValidator(String[] lineData){ this.lineData = lineData; removeLeadingAndTrailingQuotes(); try { …
deanmau5
  • 861
  • 7
  • 17
  • 27
23
votes
2 answers

What is Abstractness vs. Instability Graph?

I recently used NDepend and it produced a good report on my .net assemblies and related pdbs. The most interesting thing I found in the report was abstractness vs. instability graph. I wanted to understand this in real detail, I read their docs and…
this. __curious_geek
  • 42,787
  • 22
  • 113
  • 137
21
votes
4 answers

Difference between Sequence Diagram (SD) and a System Sequence Diagram (SSD)?

I'm working on a project for a grad class and still having trouble wrapping my head around them. What is the difference between a sequence diagram (SD) and a system sequence diagram (SSD)? And in what order should they be developed when working on…
Joshua Aslan Smith
  • 335
  • 1
  • 2
  • 12
1
2 3
17 18