behavioral design patterns

DOCX 15 стр. 838,6 КБ Бесплатная загрузка

Предварительный просмотр (5 стр.)

Прокрутите вниз 👇
1 / 15
named after muhammad al-khwarizmi tashkent university of information technologies software engineer faculty software developlement independent work group: swd401, 318-20 student: saidamin kambarov professor: raxmonova munisaxon behavioral design patterns behavioral design patterns are concerned with the interaction and responsibility of objects. in these design patterns, the interaction between the objects should be in such a way that they can easily talk to each other and still should be loosely coupled. that means the implementation and the client should be loosely coupled in order to avoid hard coding and dependencies. there are 12 types of behavioral design patterns: 1. chain of responsibility pattern 2. command pattern 3. interpreter pattern 4. iterator pattern 5. mediator pattern 6. memento pattern 7. observer pattern 8. state pattern 9. strategy pattern 10. template pattern 11. visitor pattern 12. null object chain of responsibility pattern in chain of responsibility, sender sends a request to a chain of …
2 / 15
e request must be specified in dynamic way. example of chain of responsibility pattern let's understand the example of chain of responsibility pattern by the above uml diagram. uml for chain of responsibility pattern: command pattern a command pattern says that "encapsulate a request under an object as a command and pass it to invoker object. invoker object looks for the appropriate object which can handle this command and pass the command to the corresponding object and that object executes the command". it is also known as action or transaction. advantage of command pattern · it separates the object that invokes the operation from the object that actually performs the operation. · it makes easy to add new commands, because existing classes remain unchanged. usage of command pattern: it is used: · when you need parameterize objects according to an action perform. · when you need to create and execute …
3 / 15
mmars but in this area there are better solutions that is why it is not frequently used. this pattern can applied for parsing the expressions defined in simple grammars and sometimes in simple rule engines. advantage of interpreter pattern · it is easier to change and extend the grammar. · implementing the grammar is straightforward. usage of interpreter pattern: it is used: · when the grammar of the language is not complicated. · when the efficiency is not a priority. example of interpreter pattern let's understand the example of interpreter pattern by the above uml diagram. uml for interpreter pattern: iterator pattern according to gof, iterator pattern is used "to access the elements of an aggregate object sequentially without exposing its underlying implementation". the iterator pattern is also known as cursor. in collection framework, we are now using iterator that is preferred over enumeration. advantage of iterator pattern · it …
4 / 15
o reduce communication complexity between multiple objects or classes. this pattern provides a mediator class which normally handles all the communications between different classes and supports easy maintainability of the code by loose coupling. benefits: · it decouples the number of classes. · it simplifies object protocols. · it centralizes the control. · the individual components become simpler and much easier to deal with because they don't need to pass messages to one another. the components don't need to contain logic to deal with their intercommunication and therefore, they are more generic. usage: · it is commonly used in message-based systems likewise chat applications. · when the set of objects communicate in complex but in well-defined ways. uml for mediator pattern: participants: · apnachatroom :- defines the interface for interacting with participants. · apnachatroomimpl :- implements the operations defined by the chatroom interface. the operations are managing the interactions between …
5 / 15
is also used in database transactions. uml for memento pattern: memento: · stores internal state of the originator object. the state can include any number of state variables. · the memento must have two interfaces, an interface to the caretaker. this interface must not allow any operations or any access to internal state stored by the memento and thus maintains the encapsulation. the other interface is originator and it allows the originator to access any state variables necessary to the originator to restore the previous state. originator: · creates a memento object that will capture the internal state of originator. · use the memento object to restore its previous state. caretaker: · responsible for keeping the memento. · the memento is transparent to the caretaker, and the caretaker must not operate on it. observer pattern an observer pattern says that "just define a one-to-one dependency so that when one object …

Хотите читать дальше?

Скачайте все 15 страниц бесплатно через Telegram.

Скачать полный файл

О "behavioral design patterns"

named after muhammad al-khwarizmi tashkent university of information technologies software engineer faculty software developlement independent work group: swd401, 318-20 student: saidamin kambarov professor: raxmonova munisaxon behavioral design patterns behavioral design patterns are concerned with the interaction and responsibility of objects. in these design patterns, the interaction between the objects should be in such a way that they can easily talk to each other and still should be loosely coupled. that means the implementation and the client should be loosely coupled in order to avoid hard coding and dependencies. there are 12 types of behavioral design patterns: 1. chain of responsibility pattern 2. command pattern 3. interpreter pattern 4. iterator pattern 5. mediator pattern 6. ...

Этот файл содержит 15 стр. в формате DOCX (838,6 КБ). Чтобы скачать "behavioral design patterns", нажмите кнопку Telegram слева.

Теги: behavioral design patterns DOCX 15 стр. Бесплатная загрузка Telegram