O'Reilly logo

Domain-Specific Development with Visual Studio DSL Tools by Alan Cameron Wills, Stuart Kent, Gareth Jones, Steve Cook

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7. Constraints and Validation

Introduction

When you’re programming with general purpose languages such as C# or Java, errors come in many flavors. You can mistype a keyword and get a lexical error, or you can get the order of a construct wrong and get a syntax error. These errors are the results of implicit constraints that the language imposes upon the stream of simple text that you pass to it. Strongly typed languages incorporate a type system into these constraints and produce errors at compile time, for example, when you try to set the value of a variable defined as an integer to a string value.

For many years now, good mainstream programming practice has suggested that assertions be used to impose further explicit constraints on what parameter ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required