Book Image

Mastering LOB Development for Silverlight 5: A Case Study in Action

Book Image

Mastering LOB Development for Silverlight 5: A Case Study in Action

Overview of this book

Microsoft Silverlight is fully established as a powerful tool for creating and delivering Rich Internet Applications and media experiences on the Web. This book will help you dive straight into utilizing Silverlight 5, which now more than ever is a top choice in the Enterprise for building Business Applications. "Mastering LOB Development for Silverlight 5: A Case Study in Action" focuses on the development of a complete Silverlight 5 LOB application, helping you to take advantage of the powerful features available along with expert advice. Fully focused on LOB development, this expert guide takes you from the beginning of designing and implementing a Silverlight 5 LOB application, all the way through to completion. Accompanied by a gradually built upon case study, you will learn about data access via RIA and Web services, architecture with MEF and MVVM applied to LOB development, testing and error control, and much more.With "Mastering LOB Development for Silverlight 5: A Case Study in Action" in hand, you will be fully equipped to expertly develop your own Silverlight Line of Business application, without dwelling on the basics of Enterprise Silverlight development.
Table of Contents (19 chapters)
Mastering LOB Development for Silverlight 5: A Case Study in Action
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

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

LOB application case study: applying what we have learned

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.

What this book covers

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

What you need for this book

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

Who this book is for

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.

Conventions

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".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

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 , 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.

Customer support

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.

Downloading the example code

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.

Errata

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

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 with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.