erstellt am 01.02.2009
Last week I was at the OOP 2009 in Munich. There I met a friend with who I talked about domain-specific languages. He thought critical about this topic and the theory for him seems to be clear, but he wanted an easy to understand example of an implementation. In this article I will talk about the usefulness of mini languages and show you how to implement one.

If you have programmed much since yet, you would have probably recognized the change of the way you think about solutions of your problem. What all programmers do, using a general purpose language, is that they convert their problem description to a description in their language. This means that computer languages influence how we think about a problem, and how we think about communicating. Every language has its own features and therefore designing a solution will produce different results.
When you listen to stakeholder talking about requirements of a proposed system, you will notice that they are using their own vocabulary. In object oriented programming, we always try to write code using the vocabulary of the problem domain (naming of classes, methods etc.). In some cases we can go further to the next level and actually program using the vocabulary, syntax and semantic - the language - of the domain.
Imagine you got some requirements of a proposed system. A user tells you exactly how the system works.
"The machine is listening for incoming tasks forcing it to draw lines with a specified pencil. The task description firstly explains what pencil to select and what to draw. To begin drawing lines the pencil has to be put down. Afterwards you the pencil has also to be put up.”
As you probably recognize there will be a number of such well-bounded statements to describe a drawing task. Therefore you can invent a mini language tailored to the application domain that expresses exactly what you want. Drawing a something could look like this:
SELECT_PEN 2
PUT_YOUR_PEN_DOWN
DRAW_LEFT 2
DRAW_DOWN 2
DRAW_RIGHT 2
DRAW_UP 2
PUT_YOUR_PEN_UP
This will make your application more flexible by being an interpreter of a language instead of hard coding these functions in your application. To convincingly show you that interpreting such a language isn’t much overhead and could be really valuable I created a code example at its simplest by using a line-oriented, easily parsed format. Each line consists only of a command and when needed a parameter.
<command> <parameter>
…
The example application is built in C# and uses WinForms for the user interface. At first I will discuss the parser, which is responsible for analyzing input data. Afterwards I will go over to the interpreter, which processes data and looks up the implementation of the language command.
Because I want to make the language extendable the parser is table driven. Each entry in the table contains the name of the command, a flag to say whether an argument is required, and the delegate to the concrete implementation, which handles the particular command.

The parser is pretty easy, it reads a line, looks up a command, watches for an argument if required and then calls the handler function.

The function that looks up a command performs a linear search of the table, returning either the matching entry or null.

For now, that’s it. I suggest, download the code and try it yourself. If you have any further questions don’t hesitate to contact me under denis.dwornitzak@studentpartners.de.
 |
1 Kommentar |
|
|
|
erstellt am 27.11.2008
Last week, when I was at the Xtopia, I did something new; my first interview for Channel 8.I wasn’t used to that feeling.When I hold a presentation, I’m not that nervous, but last week it was different; it was challenging.But in the end it was a lot of crack (that's irish :) for me and something I can be proud of – an interview with Dan’l Lewin, Corporate Vice President for Strategic and Emerging Business Development. Just click on that picture to watch it.

 |
2 Kommentare |
|
|
|
erstellt am 22.11.2008
Software Development is various, isn’t it? There are a lot of factors involved in a software project. You need developers who build up all the logical relationships to a whole one, then there are designers making the product attractive, and with the designer comes the user experience expert. Ultimately, you have to distribute your product, but before you need someone who feels what people want or is able to say them what they want, of course that are business people. This week I flew from Dublin to Berlin to attend the second business, design, developer and user experience conference in Berlin, called Xtopia. There I discussed much of the influencing factors of the software world.

On the pre-conference, I attended the WPF (Windows Presentation Foundation) workshop where I got pretty much more information about how this new part of the .NET framework works. The core of this workshop was WPF together with the appliance of design patterns. It was shown how to decouple such applications, also to distinguish between data, appearance and logic. Max Knor, Developer Evangelist at Microsoft Austria, introduced the "Composite Application Guidance for WPF", which is an Open Source project and helps you to build loosely coupled enterprise-level WPF client applications.
To the workshops networking was planned. I met the other Student Partners (Nadine, Janine, Miao and Lukas) who were around the conference, so we talked about all the stuff which was put into our head. That’s what I like about discussions. After that we went out to the city to get something to eat and to see some sights. And of course I was in the Vapiano at the Potsdamer Platz.
The next day was challenging, I was so tired and exhausted, but I have to go on. So I was sitting there with some tea and listen to the key note which was introduced by Dr. Said Zahedani. First was Dan’l Lewin, Corparate Vice President of Strategic and Emerging Business Development, who talks about DreamSpark and BizSpark. The second part took Carl Dichter, Director of Systems Development at MySpace.com. What I got of this key note was that competition in the IT market needs us students. Students with visions, students with sense of technology, but business issues as well.

That day, I spend almost of my time with Microsoft’s Surface in connection with multi touch user experience. They showed their visions and scenarios were Surface can be used. It’s a great technology; at the PDC they announced the Surface SDK, so people like you and me can invest some time to build new user experiences and maybe we will get the possibility to try it on an own surface desk in the future. In between presentations I talked with exhibitor and their technologies. There I saw holographic TVs and I played World of Warcraft on it; that was fun.

The Xtopia 2008 was good for me to see what is needed in the industry, what are the new technologies and why do we need such technologies. I got quite a lot of new input so I try to give you all insights at some presentations and workshops when I’m back in Germany.
 |
Keine Kommentare |
|
|
|
erstellt am 06.11.2008
Imagine that you have your own company. Business is going on well, your enterprise grows. But what would your networking infrastructure look like? There are a lot of business challenges, like growth, flexibility, storage and innovation which needs the appropriate infrastructure. Today, there is an approach called cloud computing which seems to be the answer for these challenges. Such a concept needs not only the correct hardware, but also proper software –SQL Data Services (SDS).
Cloud computing is a new way of supporting applications. In the concept of cloud computing there is a cloud platform which lets developers write applications that run in the cloud, or use services provided from the cloud, or both.

Unlike on-premises applications, applications in the cloud have different architectures. While on-premises platforms support enterprise scale applications, cloud platforms operate in internet scale, handling many more simultaneous users. This high scalability forces a cloud platform to provide functions in a different way.
SDS is such a cloud platform. It is based on HTTP and uses the SOAP and REST protocol to make queries and transfer data between the cloud and client. SDS is very flexible, because of its service interface and simple data model. To easily process and operate on data, there is also a query language which works with the service interface and data model. Do we really need a query language? Isn’t it just overhead?
On a cloud platform there are some limitations. For example, it’s not possible to access underlying operating system functions to process data, but why?
“One of the things that makes cloud computing so attractive is its potential for scalability, but to make an application built on a cloud foundation handle Internet-size loads requires limiting it in some ways.” [DavChap08]

These limitations lead to the fact that the platform has to provide the functions itself and this in a flexible and efficient way to handle a lot of user requests and to be scalable. Therefore access to data storage is done by a query language.
There’s also a different way to store data. SDS uses a three-containment level – the ACE Concept. This is a flexible data model where no schema is needed to store data. There are three levels – authority, container and entity. The authority is a unit of geo-location and has a collection of containers. A container has a collection of entities and is unit of consistency and search. An entity is a property bag of name-value pairs and therefore a unit of update and change. This data model lets the cloud arbitrarily scale.
Using SQL Data Services with REST
First of all, what you need is to register for SDS. Once you got an account, you need to download the SQL Data Services SDK. There you will find an application called SDS Explorer, which I will use for this demo.
After you opened the SDS Explorer you will see the following UI. At the top is the address bar which you need to navigate between the three-containment levels. Then there are some buttons for the support of templates and for interaction with the service. There is also a textbox for your queries and if you press the arrow button at the bottom left corner you will get additional information about your requests and responses.

The SDS Explorer uses the REST protocol to connect to the service. I first create an authority which is at the top of the ACE Concept. Therefore I use the authority template and name its ID msp-goes-sds. Then I send this statement to the service by pressing the post button. You can see the request and response in the bottom of the window. Here you will recognize that REST is based on HTTP.
NOTE: You have to choose your authority id wisely, because you can't delete or undo it at the moment.
The next step is to create a container; therefore I choose the appropriate template button. I call this container actiongames and post it. Now I’m a step deeper in the three-containment level. You can see it in the URI or by comparing these statements.
https://{authority id}.data.beta.mssds.com/v1/{container id}
https://msp-goes-sds.data.beta.mssds.com/v1/actiongames
It’s time to add some entities; there is also a particular template button for it. In the bottom box you see the basic structure of an entity. An entity can have two types of properties, metadata properties and flexible properties. The ID-tag is a metadata property and the other two, Name and ReleaseDate, are flexible properties.

In the picture you see two entities. The flexible properties of these entities differ in their kind; types and one of these entities has more properties than the other.

I repeated this step several times to have a few games in my actiongames container. Now I can query for them by using the query language. But first I have to go back to the container level. What does this mean? After I created a new entity the URI automatically move on to the entity level. 1 is the Id of the currently created entity. If you want to move back to the container you just have to delete this 1.
https://{authority id}.data.beta.mssds.com/v1/{container id}/{entity id}
https://msp-goes-sds.data.beta.mssds.com/v1/actiongames/1
Now, I can query the container for entities. I first create a query where I use a metadata property. You should recognize the difference of how to access the property data
Metadata property: from e in entities where e.Id=="1" select e
Flexible property: from e in entities where e["Name"]=="Halo 3"
Using SDS with SOAP
What you need for this part is Visual Studio 2005 / 2008. I create a new console application in Visual Studio and want to query data from the SDS service. After I created the Console Application I need a Service Reference to SDS, so I go to the project in the Solution Explorer and add a Service Reference. At next I have to find the service by enter the address and press GO. I call this Service Reference SDSClient and press Ok.

Service address: http://data.beta.mssds.com/soap/v1?wsdl
After this, I have to add the namespace by adding a using statement at the top of the source code and add the following code in the main block to query the SDS service.

At first I created a using block in which I instantiated a SitkaSoapServiceClient object. This object is the proxy for my service. Now I have to give the proxy my credentials to get access to SDS. At next I need a scope, because of the ACE concept. I define this scope at point 2. With myContainerScope.AuthorityId and myContainerScope.ContainerId I determine explicitly that I want to look for entities in the actiongames container. After that I create the query. I want all games where the ID is greater than 1. So I use the query language to build such a construct. So for now I just need to process this query. I do this at point 4. In the end I list the response to the output.
NOTE: In this article you will see sometimes the abbreviation SSDS instead of SDS, especially in pictures of the demo or in URLs of the service. This is due to a change of the name from Microsoft SQL Server Data Services (SSDS) to Microsoft SQL Data Services (SDS). It can also be that some URLs will be different after the beta status.
| [DavChap08] |
Chappell, David: Cloud Platforms – An enterprise-oriented overview. Chappell & Associates, 2008 |
| [JasLee08] |
Lee, Jason: Microsoft SQL Data Services – Under the Hood. Microsoft, 2008 |
| [MSDN08] |
MSDN Library – SQL Data Services Primer
http://msdn.microsoft.com/de-de/library/cc512417(en-us).aspx. Version: 2008. [last checked on 11/05/2008] |
Downloads
Article in PDF format
SOAP Sample Project
 |
2 Kommentare |
|
|
|
erstellt am 07.10.2008
Am 25. und 26. September war ich zusammen mit Immo und Dominik – auch zwei Student Partner aus Deutschland – auf dem weltweiten Student Partner Summit in Seattle / Redmond und ich muss sagen das es einfach genial (!) war. Großartige Sprecher, geniale Atmosphäre und zudem durften wir die Vision und Ausrichtung des Student Partners Program mit gestalten. Aber lest selbst!

Mittwoch, 24.September 2008: Ankunft in Seattle um 13.40 Uhr. Langer Flug, jetzt regnerisch, aber geschafft –ich bin in Amerika. Also mit dem nächsten Bus Richtung Bellevue, Richtung Hotel. Nur mit einem Foto vom Hotel und verschiedenen Satelliten Bildern der Hinfahrt im Kopf versuche ich mich bis zum Zielort durchzuschlagen; und tatsächlich es hat geklappt. Schon von weitem erkenne ich dass WestIn in Bellevue. Also einchecken, schlafen legen, nächster Tag – aufgewacht.
Donnerstag, 25.September 2008: Man war das Cool, ich hatte einen Chauffeur der mich nach Redmond gefahren hat. Dort gab es erst einmal Frühstück und anschließend hießen uns Jennifer Perret und Leandrod Doeyo willkommen. Danach waren die ersten beiden Sprecher Jacqueline Russell und Sam Gazitt an der Reihe. Ihr Thema war PopFly. PopFly verwendet als grundlegende Elemente sogenannte Mash-Ups, welche durch eine grafische Oberfläche zu logischen Prozessen kombiniert werden können. Dadurch können Informationen gefiltert und beliebig strukturiert werden. Viel interessanter ist der Gedanke der dahintersteckt. Um die Daten zwischen den Mash-Ups weiterzuleiten und verarbeiten zu können werden Verträge benötigt, an die sich jedes Mash-Up halten muss. Da die Mash-Ups von Entwicklern bereit gestellt werden, setzt der Endanwender nur noch beliebige Mash-Ups zusammen und formt so seinen eigenen Prozess. Das ist sozusagen eine DSL (domänenspezifische Sprache) zur Entwicklung kleinerer Projekte die auch „Nichtentwickler“ ansprechen sollen. Dadurch wird eine neue Art von „Entwicklern“ geschaffen, besser gesagt von „Bastlern“. Ähnlich verhält es sich zwischen Künstlern und Grafikdesignern.
Ich habe nach einer Weile angefangen so vor mich hinzu träumen um die Sache interessanter zu machen. Da fing ich an PopFly als eine Art „moderne“ Suchmaschine zu betrachten. Natürlich ist sie das nicht, aber ich finde es führt in die richtige Richtung. Im Internet und am Computer überhaupt dreht sich alles um Informationsverarbeitung. Mit PopFly baue ich mir kinderleicht einen Prozess, indem ich angebe welche Informationen ich wie strukturiere und auf welche Weise angezeigt haben möchte. Mache ich das geschickt, so kann ich verschiedene Prozesse bzw. Muster für unterschiedliche Suchbegriffe verwenden und mir die richtige Information zur richtigen Zeit dementsprechend anzeigen lassen. Oder was ist wenn ich beispielsweise ein Mash-Up erstelle welches für mich eine Entscheidung fällen kann – eine If-Abfrage. Ich habe durch zusammensetzen mehrerer Mash-Ups Aneinanderreihung. Durch Verbindung des Endes von einem Mash-Up mit dem Anfang des Anderen eine Wiederholung und mit dem selbst erstellen Mash-Up eine Entscheidung. Bin ich dann Turing-Äquivalent?! Stopp!

Danach ging es weiter mit „Blogging at MSFT“, was von Frank Arrigo moderiert wurde. In der Runde saßen Jeff Sandquist, Lawrence Liu, Larry “Major Nelson” Hyrb und Warren Sukernek. Es wurde alles rund um die Internetplattformen wie FaceBook, Twitter und dem Bloggen diskutiert. Was man ins Internet stellt und was nicht, wo Grenzen liegen und Tipps, wie wir unser Publikum erweitern können. Natürlich kam auch irgendwann die Frage auf was nach dem Bloggen, FaceBooken und Twittern der neue Trend sein könnte, doch das weiß noch keiner so genau.

Das nächste Thema war Open Source Software (OSS) bei Microsoft. Craig Wicks und Karri Dunn sind darauf eingegangen warum Microsoft sich ebenfalls für dieses Modell entschieden hat und stellten uns verschiedene Open Source Projekte wie beispielsweise CodePlex und Port25 vor. Es gibt verschiedene Modelle um Software zu vertreiben – Open Source, Commercial, wie auch immer – was wichtig ist, ist zu erkennen dass ein Kunde das verwendet was er benötigt und ihm in der Situation am besten erscheint. So gibt es beispielweise Unternehmen, die teilweise Open Source Software und kommerzielle Software einsetzen. Das größte Problem welches diese Unternehmen haben ist die Interoperabilität der Systeme. Microsoft setzt sich genau für diesen Punkt ein, was ich für einen guten strategischen Zug halte.
Als nächstes war Networking während dem Lunch angesagt und danach ging es mit Live Mesh weiter, was uns von Jeff Hansen präsentiert wurde. Live Mesh is eine Technologie zum synchronisieren von Daten über verschiedene Plattformen und Geräte hinweg. Sehr nützlich! Dave Mitchell präsentierte uns das XNA Game Studio und das Xbox LIVE Community Games Program. Durch das Xbox Live Community Games Program kann jeder seine mit dem XNA Game Studio erstellten Spiele einer breiten Masse zur Verfügung stellen. Das ist ziemlich cool und ermöglicht kleinen Spielentwicklern große Chancen. Anschließend gingen wir zur Company Store – erst einmal ein bisschen Shoppen – und zum House of the Future. Das ist ein Haus, in dem Szenarien im Verbund mit verschiedenen Technologien umgesetzt wurden so wie sie möglicherweise in 10 Jahren verwendet werden. Am Besten hat mir das Zimmer gefallen bei dem sich die Wände und das Ambiente je nach Person angepasst haben. Das war sehr interessant und spannend zu sehen.

Nach einem so langen und anstrengenden Tag hatten wir dann Dinner am Lincoln Square. Hier konnte ich mich mit Student Partner aus der ganzen Welt unterhalten. Wir haben zusammen mit ein paar Leuten vom XBOX Team Halo gespielt, gegessen, getrunken und einfach sehr viel Spaß gehabt. Danach war ich Tot – Müde – JetLag.
Freitag, 26.September 2008: Am zweiten Tag der Veranstaltung sprach Joe Wilson zu uns und traute uns seine Vision an – er sieht in Studenten, wie uns, die Zukunft. Wir sind diejenigen die Trends sehen und Ideen in uns tragen.

Nach solch ermutigenden Worten trat Scott Guthrie nach vorn. Ein Mann, welcher, so wie er selbst sagt, in Seattle lebt und ein paar Produkte für Microsoft erstellt. Er ist Corporate Vice President in der Microsoft Developer Division und zuständig für die CLR (Common Language Runtime) und die Core .NET Base Class Libraries, ASP.NET, Silverlight, WPF, IIS 7.0, Visual Studio Tools für ASP.NET, WPF und Silverlight. Man kann ihn also über so einiges ausfragen und das taten wir auch.
Nach einem kleinen Fotoshooting mit Scott (das fand ich lustig), gingen wir alle zum Lunch und bereiteten uns gedanklich auf den Microsoft Workshop vor. In diesem Workshop sollten wir ein kleines Stück von der Arbeitsweise innerhalb Microsoft erfahren. Jeder einzelne von uns wurde gefragt was er in nächster Zeit im Student Program verbessern möchte. Diese Ideen wurden zusammengetragen, mit ähnlichen Gedanken Anderer zusammengemischt und anschließend priorisiert. Danach wurden Teams gebildet, welche die Top Ideen weiter ausarbeiten sollten. Dafür gab es zehn Minuten Zeit; die Ausarbeitung erfolgte nach einem vorgegebenen Schema. Anschließend präsentierten wir die Ergebnisse vor dem Academic Team. Diese Ideen sollen nun innerhalb dem nächsten Jahr umgesetzt werden. Das hat total Spaß gemacht und uns gezeigt, dass wir ernst genommen werden.

Nach einer Pause ging es dann weiter mit Project Astoria was von Pablo Castro vorgetragen wurde. Project Astoria bietet Entwicklern eine Menge von Patterns für die Interaktion zwischen Datendiensten über Http. Dadurch gliedert es sich in die vorhandene Web Infrastruktur ein und unterstützt gleichzeitig den Entwickler dabei Datendienste zu entwickeln; Dienste welche unabhängig von einer Benutzeroberfläche sind.
Danach wurde uns von Andre Furtado vorgetragen wie man bei Microsoft anfangen kann und wie das Arbeitsleben bei Microsoft ist. Den Abschluss machte Millo (Emanuelle Ognissanti) Marketing Manager des Academic Programs. Er motivierte uns genau so weiter zu arbeiten. Danach ging es, wie kann es auch anders sein, ins Lucky Strike zum abschließenden Dinner und Party. Der Rest ist Confidential!
Ich danke dem Academic Relations Team in Deutschland und dem Team in Redmond die mir das ermöglicht haben. Mir hat die Veranstaltung sehr gut gefallen!
 |
Keine Kommentare |
|
|
|
erstellt am 15.09.2008
Dieses Jahr kann ich mich, was das Reisen betrifft nicht beklagen. Von verschiedenen Städten in Deutschland, über Länder wie die Slowakei und Amerika bin ich sehr viel herumgekommen. Seit dem 31. August bin ich nun in Dundalk in Irland und studiere am Institut für Technologie Games Development. Für mich ist das eine ausgezeichnete Abwechslung die ich gerade mitten im Studium sehr gebrauchen kann.

In Irland scheint es bis jetzt alles ein bisschen langsamer und ruhiger vor sich zu gehen. Am meisten stört mich im Moment die Ungenauigkeit. In der ersten und zweiten Woche herrschte in der Schule ziemliches Chaos, die Stundenpläne wurden erst nach und nach aufgestellt, die eingetragenen Vorlesungen waren Teilweise falsch bezeichnet und da stand ich nun und musste meine Kurse wählen.
Bis jetzt hatte ich dafür sehr viel Freizeit. Der Unterricht beginnt hier frühestens erst um 9 Uhr und endet allerspätestens um 17 Uhr. Mir kommt es vor wie Urlaub. Ich war bereits in Dublin und auch abends mit meinen Zimmergenossen (im wahrsten Sinne des Wortes) auf Tour und ich muss sagen mir gefällt es; bis jetzt. Das Wetter könnte mir allerdings das Genick brechen, da ich vom Herzen eher ein Südländer bin. Aber dafür war ich bereits auch schon am Strand; es war eine Tortur aber nach ein paar Stunden über Bäche springen und durch hohe Gräser Wandern hatte ich das Meer erreicht.

Was das Essen betrifft findet man hier eigentlich alle Lebensmittel wie in Deutschland auch. In Dundalk habe ich einen Abrakebabra gefunden - total lustig diese Bezeichnung - nur leider hat er keinen Spieß?!
Das war nun mein erster Bericht über Irland. In zwei Wochen geht es dann vom ruhigen Dundalk in das chaotische Seattle. Ich freue mich schon sehr, denn ich fliege zum weltweiten Student Partner Summit 2008 nach Redmond und werde natürlich von dort aus meine „Hilfe es regnet“ Reihe fortsetzen.
 |
2 Kommentare |
|
|
|