What is difference between patterns decorator and adapter?
{
"id": "a1rqz4tTIfiuIOgdQt5Lm3ih",
"question": "What is difference between patterns decorator and adapter?",
"answers": [
"Decorator and adapter are the same pattern",
"Decorator changes behavior, but not interface. Adatper changes interface, but not behavior",
"Decorator add behavior for existing class and adapter defines a family of algorithms, put each of them into a separate class, and make their objects interchangeable."
],
"correctAnswers": [
"Decorator changes behavior, but not interface. Adatper changes interface, but not behavior"
],
"incorrectAnswers": [
"Decorator and adapter are the same pattern",
"Decorator add behavior for existing class and adapter defines a family of algorithms, put each of them into a separate class, and make their objects interchangeable."
],
"allowCustomAnswer": false,
"canEdit": false,
"allowFileAnswer": false,
"multi": false,
"explanation": "",
"canLike": false,
"likes": 0,
"allAnswers": [
{
"text": "Decorator add behavior for existing class and adapter defines a family of algorithms, put each of them into a separate class, and make their objects interchangeable.",
"correct": false,
"selected": false
},
{
"text": "Decorator and adapter are the same pattern",
"correct": false,
"selected": false
},
{
"text": "Decorator changes behavior, but not interface. Adatper changes interface, but not behavior",
"correct": true,
"selected": false
}
]
}