mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-07 01:46:53 +01:00
Add interfaces knowledge domain and review leaf skill
Adds the interfaces knowledge domain covering AL interfaces and enum-with-implementation: three atomic articles with good/bad AL samples, a new al-interfaces-review leaf skill, and additive wiring into al-code-review and the README. Purely additive; no contract change. Part of #34. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
4a7a34b5c9
commit
484ee120af
12 changed files with 458 additions and 2 deletions
|
|
@ -0,0 +1,39 @@
|
|||
interface INotifier
|
||||
{
|
||||
procedure Send(Recipient: Text; Body: Text): Boolean;
|
||||
}
|
||||
|
||||
codeunit 50210 "Email Notifier Bad" implements INotifier
|
||||
{
|
||||
procedure Send(Recipient: Text; Body: Text): Boolean
|
||||
begin
|
||||
exit(Recipient <> '');
|
||||
end;
|
||||
}
|
||||
|
||||
enum 50211 "Notification Channel Bad" implements INotifier
|
||||
{
|
||||
Extensible = true;
|
||||
// No DefaultImplementation declared.
|
||||
|
||||
value(0; Email)
|
||||
{
|
||||
Implementation = INotifier = "Email Notifier Bad";
|
||||
}
|
||||
value(1; None)
|
||||
{
|
||||
// No Implementation here and no enum-level DefaultImplementation:
|
||||
// resolving this value to INotifier and calling Send fails at runtime.
|
||||
}
|
||||
}
|
||||
|
||||
codeunit 50212 "Notification Dispatch Bad"
|
||||
{
|
||||
procedure Notify(Channel: Enum "Notification Channel Bad"; Recipient: Text; Body: Text): Boolean
|
||||
var
|
||||
Notifier: Interface INotifier;
|
||||
begin
|
||||
Notifier := Channel; // Channel::None has no implementation
|
||||
exit(Notifier.Send(Recipient, Body)); // runtime failure for the None value
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue