Questions tagged [software-design]

Software design is the activity of deciding what properties, elements, responsibilities, interfaces, relationships and interactions are required in order to create an effective piece of software.

According to Wikipedia, software design is:

Software design is the process by which an agent creates a specification of a software artifact, intended to accomplish goals, using a set of primitive components and subject to constraints. Software design may refer to either "all the activities involved in conceptualizing, framing, implementing, commissioning, and ultimately modifying complex systems" or "the activity following requirements specification and before programming, as ... [in] a stylized software engineering process."

1966 questions
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
206
votes
12 answers

What is a software framework?

Can someone please explain me what a software framework is? Why do we need a framework? What does a framework do to make programming easier?
Anxious
  • 2,175
  • 2
  • 14
  • 4
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
171
votes
13 answers

When to use the Bridge pattern and how is it different from the Adapter pattern?

Has anyone ever used the Bridge pattern in a real world application? If so, how did you use it? Is it me, or is it just the Adapter pattern with a little dependency injection thrown into the mix? Does it really deserve its own pattern?
Charles Graham
  • 24,293
  • 14
  • 43
  • 56
114
votes
14 answers

Are utility classes evil?

I saw this question: If a "Utilities" class is evil, where do I put my generic code? And I thought, why are utility classes evil? Let’s say I have a domain model that is dozens of classes deep. I need to be able to xml-ify instances. Do I make a…
hvgotcodes
  • 118,147
  • 33
  • 203
  • 236
103
votes
6 answers

What is the benefit of using Fragments in Android, rather than Views?

When developing for Android, you can set your target (or minimum) sdk to 4 (API 1.6) and add the android compatibility package (v4) to add support for Fragments. Yesterday I did this and successfully implemented Fragments to visualize data from a…
Phil
  • 35,852
  • 23
  • 123
  • 164
95
votes
15 answers

adapter-Any real example of Adapter Pattern

I want to demonstrate use of Adapter Pattern to my team. I've read many books and articles online. Everyone is citing an example which are useful to understand the concept (Shape, Memory Card, Electronic Adapter etc.), but there is no real case…
AksharRoop
  • 2,263
  • 1
  • 19
  • 29
81
votes
5 answers

What are the DAO, DTO and Service layers in Spring Framework?

I am writing RESTful services using spring and hibernate. I read many resource in internet, but they did not clarify my doubts. Please explain me in details what are DAO, DTO and Service layers in spring framework? And why usage of these layers is…
Prathap Badavath
  • 1,621
  • 2
  • 20
  • 24
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
70
votes
13 answers

Is it the best practice to extract an interface for every class?

I have seen code where every class has an interface that it implements. Sometimes there is no common interface for them all. They are just there and they are used instead of concrete objects. They do not offer a generic interface for two classes and…
the_drow
  • 18,571
  • 25
  • 126
  • 193
65
votes
6 answers

what is the difference between a view model and a data transfer object?

I'm basing this question on Fowler PoEAA. Given your familiarity with this text, aren't the ViewModels used in ASP.NET MVC the same as DTOs? Why or why not? Thank you.
mkelley33
  • 5,323
  • 10
  • 47
  • 71
64
votes
8 answers

Avoiding Circular Dependencies of header files

Do you have any good advice on how to avoid circular dependencies of header files, please? Of course, from the beginning, I try to design the project as transparent as possible. However, as more and more features and classes are added, and the…
Bunkai.Satori
  • 4,698
  • 13
  • 49
  • 77
63
votes
5 answers

Onion architecture compared to hexagonal

Is there any difference between them (onion | hexagonal), from my understanding they are just the same, they focus upon the domain which is at the core of the application and should be technology / framework agnostic. What are the differences…
61
votes
20 answers

Encapsulation vs Data Hiding - Java

Interviewer: What is encapsulation and how do you achieve it in Java? Me: Encapsulation is a mechanism to hide information from the client. The information may be data or implementation or algorithm. We achieve this using access modifiers.…
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
49
votes
5 answers

Find Number of CPUs and Cores per CPU using Command Prompt

I am trying to retrieve the Number of CPUs and Cores per CPU using Command Prompt. I have executed the following command: wmic cpu get NumberOfCores, NumberOfLogicalProcessors/Format:List I get this error: wmic' is not recognized as an internal or…
Mustafa
  • 755
  • 1
  • 7
  • 16
1
2 3
99 100