The Controller pattern assigns the responsibility of dealing with system events to a non- UI class that represent the overall system or a use case scenario. This is achieved by creating a Pure Fabrication object (see below), called Factory that handles the creation. The Factory pattern is a common alternative to Creator when there are special considerations, such as complex creation logic. It could then be stated that B is natural object to be a creator of A objects. Given two classes, class B and Class A, class B should be responsible for the creation of A if class B contains or compositely aggregates, records, closely uses or contains the initializing information for class A. A system that effectively utilizes the creator pattern can also support low coupling, increased understandability, encapsulation and the likelihood that the object in question will be capable of sustaining reuse. The creator pattern is important because creation of objects is one of the most ubiquitous activities in an object-oriented system. The Creator pattern solves the problem of who should be responsible for the creation of a new instance of a class. Thus, GRASP is really a mental toolset, a learning aid to help in the design of object oriented software. "Applying UML and Patterns - Third Edition". It is not the UML or any other technology" ( Larman, Craig. "The critical design tool for software development is a mind well educated in design principles. All these patterns answer some software problem, and in almost every case these problems are common to almost every software development project, thus they don't exist to facilitate new information but to better document and standardize old, tried-and-true programming principles in object oriented design. It is used in object oriented design, and gives guidelines for assigning responsibility to classes and objects.Įxamples of different patterns/principles used in GRASP are: Information Expert, Creator, Controller, Low Coupling, High Cohesion, Polymorphism, Pure Fabrication, Indirection, Protected Variations. GRASP stands for General Responsibility Assignment Software Patterns (or sometimes Principles).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |