MB-500 · Question #301
Case study 4 - ADatum Corporation Background ADatum Corporation is a market leader in the design and distribution of innovative aluminum systems. The company provides services to the architectural…
The correct answer is B. [Hookable(false)]. A method named processAttachment must be created so that extenders are not able to subscribe to pre-events and post-events. A base class named MigrateAttachment must be designed with methods that all child classes D365 Extensibility Attributes To control the Extensibility of…
Question
Exhibit
Options
- A[Wrappable(true)]
- B[Hookable(false)]
- C[Replaceable(true)]
- D[Replaceable(false)]
How the community answered
(51 responses)- B94% (48)
- C2% (1)
- D4% (2)
Explanation
A method named processAttachment must be created so that extenders are not able to subscribe to pre-events and post-events. A base class named MigrateAttachment must be designed with methods that all child classes D365 Extensibility Attributes To control the Extensibility of our Custom code we have three attributes As we know we cannot create event handlers on methods that are Protected or private. So, using Hookable attribute in our code helps to control the event handlers (Pre or Post) and Extensions for our methods By using Hookable(true) attribute you can expose even Protected and private methods to event handlers (without Hookable attribute event handlers can be implemented only on public Similarly, you can disable event handlers for your methods by using Hookable(false) attribute. Note: by using Hookable(false) attribute it overrides CoC(Chain of command) as well and those methods cannot have extensions. If a method is replaceable, extenders can wrap it by using CoC, but they don't have to unconditionally call next. Although extenders can break the CoC, the expectation is that they will only conditionally break it. The compiler doesn't enforce calls to next. Wrappable attribute is used to control CoC (Chain of command) implementation for the methods Wrappable(false) can be used for public and protected methods to prevent Extending the method https://community.dynamics.com/blogs/post/?postid=f02da943-4897-40d9-a55b-b8fdd865e515
Topics
Community Discussion
No community discussion yet for this question.
