Management applications, also known as Line of Business (LOB) applications, constitute a great piece of the pie, that is the software development market. Until a few years ago, a management application used to be implemented as a desktop app. However, this approach has some drawbacks, as globalization pushes us to implement information systems that support remote access via a standard web browser.
Targeting an LOB application to run on a web platform adds greater complexity to such a development, bearing in mind the fact that the Web was not conceived to host applications which need heavy interaction with the user. Derived from this necessity, the term Rich Internet Application (RIA) emerged. RIAs are web applications that are used in a similar way to desktop applications.
Silverlight 5 is Microsoft's commitment to the implementation of RIA, which will allows us, among other things:
To implement an application from beginning to end with powerful languages (C#, VB.NET, and so on), with no more of JavaScript
To implement advanced UI (XAML markup language)
To work with professional data access (WCF, RIA Services, Entity Framework, and so on)
To decouple designer and developer roles
To have the user able to install the application as if it was a desktop one
With the purpose of applying theoretical concepts, the contents of this book are accompanied by the implementation of an LOB application. In this case, it is an application intended for office space reservations. We have chosen this kind of application, as it includes the following features:
It contains master-detail relationships.
It's implemented as a real project, using best practices (MVVM pattern based, unit testing, and so on). It allows us to implement a standard management application interface, as well as a more advanced one (Bing Maps integration).
It incorporates user roles (administrator/average user).
At the end of every chapter, we will implement the most significant parts of this app. You can see a map of the site we are going to create in the following figure:
The details of every window can be seen in the following screenshots:
My reservations and CRUD (Create, Read, Update, and Delete) reservations:
Choose building:
CRUD floors:
CRUD rooms:
The application prototype is available for download at www.packtpub.com.
Chapter 1, Express Introduction to Silverlight, introduces the basic concepts for those who have not previously worked with this technology. In case you have experience with Silverlight, you can skip this chapter or read it as reinforcement.
Chapter 2, Forms and Browsing, explains how the standard line of a business user interface is implemented in Silverlight (views, child windows, and navigation framework).
Chapter 3, Data Binding, explains how data binding works (a connection between the UI controls and data objects), allowing us to decouple the presentation layer of the business layer (data, validations, and so on).
Chapter 4, Architecture, explains how to define an architecture for our application. For this reason, we will cover a series of patterns, as well as their application in Silverlight (MVVM, MVVM Light Toolkit, MEF, and so on).
Chapter 5, RIA Services Data Access, explains how to interact with databases, via technologies such as WCF, RIA Services, and ADO.NET Entity Framework.
Chapter 6, Out of Browser (OOB) Applications, explains how to install our own application on our client's desktop, and even ask the user for elevated permissions in order to communicate via COM or P/Invoke with other components.
Chapter 7, Testing your LOB Application, explains how to implement automatic unit testing and UI testing.
Chapter 8, Error Control, explains how to deal with server communication errors and application execution errors.
Chapter 9, Integration with other Web Applications, explains how to integrate a Silverlight component in an existing web application and how to establish communication between JavaScript and Silverlight.
Chapter 10, Consuming Web Services, explains how to integrate WCF Web Services in our application.
Chapter 11, Security, explains how to deal with security regarding:
Application: Those aspects which make a Silverlight application secure so as to run in a web client
Communications: What should be done to secure our communications
Authentication/Authorization: How can a login page and authentication/authorization levels be added to a Silverlight application
In order to compile and run the sample code included in this book, you will need to install:
Visual Studio 2010
Visual Studio 2010 SP1
Silverlight 5 Tool for Visual Studio 2010 SP1
This book is aimed at:
Developers who have previously worked with Silverlight
Web developers who have some knowledge of Line of Business applications
Software architects who want to learn how to define an LOB architecture for a Silverlight-based development and how to solve common LOB challenges
If you already have a firm grasp of Silverlight development and are keen to advance your specialist knowledge of Line of Business (LOB) application development, then Mastering LOB Development for Silverlight 5: A Case Study in Action is for you.
If you are a developer with experience with other technologies, you may also find this book useful.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "We can include other contexts through the use of the include
directive."
A block of code is set as follows:
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right"> <Button Content="New" Width="60" Height="30"/> <Button Content="Save" Margin="5,0,0,0" Width="60" Height="30"/> <Button Content="Delete" Margin="5,0,0,0" Width="60" Height="30"/> </StackPanel>
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Grid x:Name="LayoutRoot" Background="White">
<TextBlock Text="Hello World!" FontSize="20"/>
</Grid>
Any command-line input or output is written as follows:
install-package Moq
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "For Comments textbox to occupy all of the grid width, we add a property called ColSpan
".
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title through the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.