Domain-Specific Languages (Addison-Wesley Signature Series)

By Martin Fowler

Whilst rigorously chosen and used, Domain-Specific Languages (DSLs) may perhaps simplify advanced code, advertise powerful communique with consumers, increase productiveness, and unclog improvement bottlenecks. In Domain-Specific Languages, famous software program improvement professional Martin Fowler first offers the knowledge software program execs have to make a decision if and while to make use of DSLs. Then, the place DSLs turn out compatible, Fowler offers powerful concepts for development them, and courses software program engineers in selecting the best techniques for his or her functions.
This book’s thoughts could be applied with newest object-oriented languages; the writer presents a variety of examples in Java and C#, in addition to chosen examples in Ruby. anyplace attainable, chapters are geared up to be self-standing, and such a lot reference themes are provided in a well-known styles structure.
Armed with this wide-ranging e-book, builders may have the information they should make very important judgements approximately DSLs—and, the place acceptable, achieve the numerous technical and company advantages they provide.

The themes coated include:
•      How DSLs evaluate to frameworks and libraries, and while these possible choices are sufficient
•      utilizing parsers and parser turbines, and parsing exterior DSLs
•      knowing, evaluating, and selecting DSL language constructs
•      picking out even if to exploit code new release, and evaluating code new release strategies
•      Previewing new language workbench instruments for developing DSLs

Show description

Preview of Domain-Specific Languages (Addison-Wesley Signature Series) PDF

Similar Java books

Mastering Lambdas: Java Programming in a Multicore World (Oracle Press)

The Definitive advisor to Lambda Expressions learning Lambdas: Java Programming in a Multicore global describes how the lambda-related gains of Java SE eight will allow Java to fulfill the demanding situations of next-generation parallel architectures. The publication explains the best way to write lambdas, and the way to take advantage of them in streams and in assortment processing, supplying code examples all through.

Mastering JavaFX 8 Controls (Oracle Press)

Layout and installation High-Performance JavaFX Controls bring cutting-edge functions with visually beautiful UIs. learning JavaFX eight Controls offers transparent directions, exact examples, and ready-to-use code samples. the best way to paintings with the most recent JavaFX APIs, configure UI parts, instantly generate FXML, construct state of the art controls, and successfully follow CSS styling.

Data Abstraction and Problem Solving with Java: Walls and Mirrors (3rd Edition)

The 3rd version of info Abstraction and challenge fixing with Java: partitions and Mirrors employs the analogies of partitions (data abstraction) and Mirrors (recursion) to coach Java programming layout suggestions, in a manner that starting scholars locate available. The publication has a student-friendly pedagogical process that conscientiously debts for the strengths and weaknesses of the Java language.

Java Software Solutions: Foundations of Program Design (7th Edition)

Java software program strategies teaches a beginning of programming ideas to foster well-designed object-oriented software program. Heralded for its integration of small and massive lifelike examples, this around the world best-selling textual content emphasizes construction strong problem-solving and layout talents to put in writing top quality courses.

Additional info for Domain-Specific Languages (Addison-Wesley Signature Series)

Show sample text content

Picking out What to Generate one of many first issues to make a decision whilst producing code is, what sort of code are you going to generate? the way in which i glance at issues, there are kinds of code iteration you should use: Model-Aware new release and version Ignorant new release. the variation among the 2 lies in even if you will have an particular illustration of the Semantic version within the aim surroundings. determine . an easy nation laptop for example, shall we say a country laptop. vintage possible choices for imposing a nation laptop are nested conditionals and country tables. If we take an easy country version, similar to determine , a nested conditional strategy may appear like this: public void handle(Event occasion) { change (currentState) { case ON: swap (event) { case DOWN: currentState = OFF; } case OFF: change (event) { case UP : currentState = ON; } } } we now have conditional exams nested one contained in the different. The outer conditional appears on the present kingdom of the laptop and the internal conditional switches at the occasion that is simply been obtained. this is often version Ignorant new release as the common sense of the country desktop is embedded into the keep watch over movement of the language—there's no specific illustration of the Semantic version. With Model-Aware new release we positioned a few illustration of the semantic version into the generated code. This need not be the exact same as that utilized in the DSL processor, however it may be a few type of info illustration. For this situation, our country desktop is a marginally extra advanced. Code View: Scroll / convey All type ModelMachine... deepest nation currentState; deepest Map> states = new HashMap>(); public ModelMachine(State currentState) { this. currentState = currentState; } void defineTransition(State resource, occasion set off, country goal) { if (! states. containsKey(source)) states. put(source, new HashMap()); states. get(source). put(trigger, target); } public void handle(Event occasion) { Map currentTransitions = states. get(currentState); if (null == currentTransitions) go back; nation objective = currentTransitions. get(event); if (null ! = objective) currentState = aim; } right here i am storing the transitions as nested maps. The outer map is a map of states, whose key's the nation identify, and price is a moment map. This internal map has the development identify because the key and the objective country because the price. it is a crude nation model—I won't have particular kingdom, transition, and occasion classes—but the information constitution captures the habit of the kingdom laptop. because of being data-driven, this code is fullyyt primary and wishes to be configured via a few particular code to make it paintings. modelMachine = new ModelMachine(OFF); modelMachine. defineTransition(OFF, UP, ON); modelMachine. defineTransition(ON, DOWN, OFF); through placing a illustration of the Semantic version into the generated code, the generated code takes at the similar cut up among conventional framework code and particular configuration code that I spoke of within the advent.

Download PDF sample

Rated 4.94 of 5 – based on 20 votes