Session

Case against 'case': how to write truly extensible code

Writing extensible code has always been a sort of a holy grail of Business Central, both for Microsoft and the ISV channel. Allowing third parties to extend your business logic without either interfering with your existing logic, or without relying on you to make changes on demand, has always been an issue. Recently, extensible enums seemed to allow free extensibility, but the practice has shown that marking enums as extensible is a big promise to make, and one that requires a lot more forethought than any other approach.

This session puts our existing practices under a big question mark, especially when it comes to the 'case' statement. Often perceived as a cornerstone of extensibility and intricate business logic, the 'case' statement paradoxically stands in opposition to the principles of clean code. While in AL 'case' seems natural and necessary, 'case' statements in fact indicate lack of design and lead to rigid, inflexible code structures that hinder extensibility and maintainability. Furthermore, the session scrutinizes the 'handled pattern', a prevalent approach in extensibility that, upon closer inspection, reveals itself as an antipattern that emerges as a necessary evil in scenarios where extensibility is more important than clean, maintainable, reliable, or testable code. In the end, all these practices lead to high cost of building, testing, and maintaining solutions.

Instead of only exposing the problems with existing approaches, this session provides alternatives at every step. You'll see how proper design and forethought coupled with some advanced coding practices and techniques can produce code that's easier to write and read, and also test, but that costs far less to maintain in the long run, and where extensibility comes as a natural, almost effortless outcome.

This session will profoundly change the way how you look at writing AL code, and you'll leave with with one question only: "why haven't I known all this before?" That's a promise.

Vjekoslav Babic

Solutions Architect | MVP

Zagreb, Croatia

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top