I was on a phone interview the other day where I was asked for my definition of “Good Code”.
The first thought that came to mind was maintainability – if it can’t be understood, maintained and extended by other developers than its definitely not good.
Then, other things came to mind: efficiency, elegance (simple, proper use of language constructs and environment capabilities), modularity, proper object-oriented design, …
I wrote the stocky application more than a year ago as a research project aimed at proving that using WPF we can separate presentation metadata (XAML) from program logic. The goal was to provide the Duet team at SAP with a document reference sample for using M-V-VM to achieve this separation.
On the previous post in this series we looked into the DataModel component in our architecture in detail and defined an abstract DataModel base class to derive our models from.
On this post we’ll implement a concrete data model to represent a stock’s value.\
Why stock? It’s an object with a changing value that requires our DataModel constantly refresh and keep its data “alive”, and it’s simple to implement which makes it a perfect example for our first DataModel.
In the first post in the series I gave an overview of the pattern we’ll be using.
This post will go deeper into the DataModel, as defined in the previous post:
The DataModel is defined exactly as the Model in MVC; it is the data or business logic that stores the state and does processing of the problem domain.
WPF, Microsoft’s not-so-new-anymore UI technology offers new capabilities allowing both developers and designers to work together to achieve a stunning experience for their applications.
Power, however, does not come without complexity, and WPF does not provide a framework or a model to solve many of the problems faced by developers and designer when building an application:
I decided to publish a prolog project I wrote about 4 years ago for an Introduction to AI course at the university. The project is an implementation of the “four in a row” game in Prolog language (using AMZI prolog). The paper itself is in hebrew but the code is universal ;)