Textual DSLs in Visual C#.NET

Creation Denso QR Bar Code in Visual C#.NET Textual DSLs
Textual DSLs
Printing QR Code In C#
Using Barcode generation for .NET framework Control to generate, create QR image in VS .NET applications.
xmlns:xs="http://wwww3org/2001/XMLSchema" targetNamespace="http://schemasmicrosoftcom/dsltools/ch01"> <xs:element name="Shapes"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Shape"> <xs:complexType> <xs:sequence> <xs:element name="Kind" type="kind" /> <xs:element name="Width" type="xs:decimal" /> <xs:element name="Height" type="xs:decimal" /> <xs:element name="FillColor" type="xs:string" /> <xs:element name="OutlineColor" type="xs:string" /> <xs:element maxOccurs="unbounded" name="Decorator"> <xs:complexType> <xs:sequence> <xs:element name="Position" type="position" /> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name="position"> <xs:restriction base="xs:string"> <xs:enumeration value="Center" /> <xs:enumeration value="TopLeft" /> <xs:enumeration value="TopRight" /> <xs:enumeration value="BottomLeft" /> <xs:enumeration value="BottomRight" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="kind"> <xs:restriction base="xs:string"> <xs:enumeration value="Rectangle" /> <xs:enumeration value="RoundedRectangle" /> <xs:enumeration value="Ellipse" /> </xs:restriction> </xs:simpleType> </xs:schema>
Barcode Creation In C#.NET
Using Barcode creator for Visual Studio .NET Control to generate, create bar code image in .NET framework applications.
1: Domain-Spe cific Development
Making QR In .NET
Using Barcode generator for ASP.NET Control to generate, create QR Code ISO/IEC18004 image in ASP.NET applications.
To summarize, in this section we have looked at three ways of de ning a textual DSL: using a parser-generator, writing con guration code embedded in a host language, and using XML with a schema to help validate your documents and provide syntax coloring and autocompletion A further option would be to de ne an equivalent to the DSL Tools that targeted textual languages Each of these approaches has its pros and cons, but they all share a common theme investing some resources early in order to de ne a language that will make it easier to solve speci c problems later This is the basic pattern that also applies to graphical DSLs, as we shall see The DSL Tools themselves provide no facilities in version 1 for de ning textual domain-speci c languages The Tools authors have taken the view that XML provides a suf ciently good approach to start with, and so they have designed the DSL Tools to integrate XML-based textual DSLs with graphical DSLs
Generate QR-Code In VS .NET
Using Barcode maker for Visual Studio .NET Control to generate, create QR Code JIS X 0510 image in .NET applications.
Graphical DSLs
QR Encoder In VB.NET
Using Barcode encoder for .NET Control to generate, create QR Code image in .NET framework applications.
So far we have looked at some of the background behind Domain-Specific Development and discussed its benefits We have also looked briefly at textual DSLs Let s start our exploration into graphical DSLs by looking at an example that captures data for deploying and managing distributed applications Figure 1-10 shows a simple model built using a graphical DSL for designing logical data centers This DSL is part of Visual Studio 2005 Team Architect The elements of this language include zones, depicted by rectangular areas surrounded by dashed lines; hosts, depicted by rectangular areas surrounded by solid lines; endpoints, depicted by small shapes (squares, circles, and hexagons) placed on the edges of hosts; and connections, depicted by arrows between endpoints This model corresponds exactly to an XML le that contains information according to the rules of the System De nition Model (SDM), which is used for con guring and managing data centers
Barcode Creator In Visual C#
Using Barcode generator for .NET Control to generate, create bar code image in .NET framework applications.
Graphical DSLs
Encoding Bar Code In C#
Using Barcode printer for .NET Control to generate, create bar code image in .NET framework applications.
Figure 1-10: Data center design
Making Code 39 Full ASCII In Visual C#
Using Barcode generation for VS .NET Control to generate, create Code39 image in .NET framework applications.
System Definition Model
Code 128 Creator In C#.NET
Using Barcode generation for .NET framework Control to generate, create Code 128A image in .NET framework applications.
SDM was created as part of Microsoft s Dynamic Systems Initiative, which promises to deliver self-managing dynamic systems that will result in reduced operational costs and increased business agility A later version of this model, called SML (Service Modeling Language), is being standardized by industry leaders, which should eventually enable distributed systems with components from multiple vendors to be managed using these models
DataMatrix Drawer In C#
Using Barcode maker for VS .NET Control to generate, create Data Matrix image in .NET applications.
We can build up graphical DSLs like this one from a set of simple diagrammatic conventions such as the following Many of these conventions are derived from UML, which we discuss in more depth later
Bar Code Creation In VB.NET
Using Barcode generator for VS .NET Control to generate, create bar code image in Visual Studio .NET applications.
Conventions for Representing Structure See Figure 1-11 for examples of structural conventions, including:
UPC Symbol Printer In Java
Using Barcode drawer for Java Control to generate, create UPC-A Supplement 5 image in Java applications.
Nested rectangle or rounded rectangles, to represent structural containment Rectangles with headers, sections, and compartments, to represent objects, classes, entities, devices, and so on Solid and dashed connectors with multiplicities, names, arrowheads, and other adornments, to represent relationships, associations, connections, and dependencies
UPCA Reader In .NET Framework
Using Barcode recognizer for VS .NET Control to read, scan read, scan image in VS .NET applications.
1: Domain-Spe cific Development
Draw Code 39 Extended In VB.NET
Using Barcode generation for .NET framework Control to generate, create Code 39 Extended image in Visual Studio .NET applications.
Connectors with large open triangular arrowheads, to represent generalization, inheritance, and derivation Ports on the edges of shapes, to represent connectable endpoints
Paint Bar Code In .NET Framework
Using Barcode generator for Visual Studio .NET Control to generate, create bar code image in VS .NET applications.
Header
Barcode Generator In Visual Studio .NET
Using Barcode creator for ASP.NET Control to generate, create bar code image in ASP.NET applications.
-Compartment
Universal Product Code Version A Maker In VS .NET
Using Barcode creator for .NET framework Control to generate, create Universal Product Code version A image in .NET framework applications.
Containment
Recognize Data Matrix In VS .NET
Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET framework applications.
Compartments
Barcode Creation In Java
Using Barcode creator for Java Control to generate, create bar code image in Java applications.
Connectors
EAN13 Reader In .NET Framework
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in .NET framework applications.
Generalization Figure 1-11: Structural conventions
Ports
Conventions for Representing Behavior See Figure 1-12 for examples of behavioral conventions, including:
Lifelines and arrows, to represent sequences of messages or invocations with a temporal axis Rounded rectangles, arrows, swimlanes, diamonds, transition bars, and so on, to represent activities and ows Nested ovals and arrows, to represent states and transitions Ovals and stick people, to represent use cases and actors Using the DSL Tools, it is possible to build your own graphical language that combines conventions like these in a way that matches your particular problem (although version 1 of the Tools does not fully support all of the conventions listed) You can map them onto the concepts of your own domain and construct a customized graphical modeling language that solves your own problem We saw an example in the data center design language shown in Figure 1-10, and we ll see many other examples as we proceed