Questions tagged [grasp]

General Responsibility Assignment Software Patterns (or Principles), abbreviated GRASP, consists of guidelines for assigning responsibility to classes and objects in object-oriented design.

General Responsibility Assignment Software Patterns (or Principles), abbreviated GRASP, consists of guidelines for assigning responsibility to classes and objects in object-oriented design.

The different patterns and principles used in GRASP are: Controller, Creator, Indirection, Information Expert, High Cohesion, Low Coupling, Polymorphism, Protected Variations, and Pure Fabrication. All these patterns answer some software problem, and in almost every case these problems are common to almost every software development project. These techniques have not been invented to create new ways of working, but to better document and standardize old, tried-and-tested programming principles in object-oriented design.

(Extracted from the Wikipedia article on GRASP)

31 questions
17
votes
3 answers

Difference between Pure fabrication and Indirection

I was trying to find tutorials and good examples which would explain difference between those two, but not able to find any information. Pure fabrication and indirection acts to create and assign responsibilities to intermediate object, so could…
John Latham
  • 255
  • 1
  • 2
  • 9
15
votes
2 answers

What is the Difference between GOF and GRASP design patterns

I am really confused about the difference between GOF and GRASP patterns? even both contribute to improved Object oriented practices
Afnan Bashir
  • 7,319
  • 20
  • 76
  • 138
5
votes
1 answer

Grasp creator vs. dependency Injection

Is GRASP Creator a complete contradiction to Dependency Injection? If it is not, please explain why.
5
votes
1 answer

Service layer = Application layer = GRASP Controller layer

I think service/application layer is the same thing as Larman describes as GRASP Controller, being the first object beyond the GUI layer that delegates to the domain layer, and should be reusable from different GUI. Service (Evans) layer is the same…
ech0s7r
  • 337
  • 2
  • 14
5
votes
2 answers

What exactly is GRASP's Controller about?

What is the idea behind Grasp's Controller pattern? My current interpretation is that sometimes you want to achieve something that needs to use a couple of classes but none of those classes could or has access to the information needed to do it, so…
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
4
votes
2 answers

What is the difference between GRASP information expert and GRASP cohesion?

Both concepts are very similar it is hard to tell which is which. Please give an example of how you would differentiate them.
Vizzle
  • 203
  • 3
  • 9
3
votes
2 answers

SOLID GRASP controller pattern?

I have a question about applying the GRASP controller pattern while keeping it SOLID, more specifically, while keeping it with a single responsibility. Wikipedia's Controller Pattern definition says: The Controller pattern assigns the…
2
votes
2 answers

Does GRASP Creator really decouples?

I'm learning GRASP pattern at school and I have a question about the Creator pattern. Let's say you have three class, Computer, UserRespository and User. One of the rules of the GRASP Creator pattern tells you to assign the responsibility of…
subb
  • 1,578
  • 1
  • 15
  • 27
2
votes
1 answer

Facade controller, is it efficient?

Using a facade controller pattern in .net. It seems as if though it is not efficient BECAUSE, for every event that happens in a domain object(Sales, Register, Schedule, Car) it has to be subscribed to by the controller(use case controller) and then…
dannyrosalex
  • 1,794
  • 4
  • 16
  • 25
2
votes
0 answers

Refactor Javascript objects and properties

I have some code I may want to refactor many times. Imagine, something like this: Namespace.CustomObject = function(name,type){ this.name = name; this.type = type; }; Namespace.CustomObject.prototype = { writeName: function(){ …
2
votes
0 answers

GRASP - information expert pattern - approach

I'm looking for best-practice approach in the following case. I have three Java classes: ManualComponent, AutomaticComponent and CustomComponent, which extend abstract class CalculationComponent and implement the following CalculableComponent…
monczek
  • 1,142
  • 2
  • 13
  • 28
2
votes
3 answers

Business Rule Split among two classes

I have a project allocation domain with the following business rules When a new employee is getting allocated to a project the total expenditure should not exceed the Budget Amount. For an employee the total allocation percentage should not exceed…
LCJ
  • 22,196
  • 67
  • 260
  • 418
1
vote
0 answers

Pybullet - Gripper is not able to Grasp Object

I am using the Kinova Jaco robotic arm with the j2n6s300.urdf file and I simply want to grasp a mug from the side and live it up. However, the gripper is not able to pick up the mug. It seems that there is an "invisible" barrier between gripper…
1
vote
1 answer

Does Information Expert pattern contradict Service Layer Pattern?

While reading about GRASP patterns I stopped at Information Expert, which states that behavior on classes state should be within that same class. But that is a complete opposite with Service Layer pattern which I used for years. Services have…
1
vote
1 answer

Improving my code with loose coupling or high coupling if any?

I want to improve my code using GRASP by creating an even lower coupling to my code. In my example I'm not sure whether I'm making lower coupling at all, and if I'm making loose coupling instead of high coupling? I'm making my project using Spring…
Gustav Vingtoft
  • 355
  • 2
  • 16
1
2 3