Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF
MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF

MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF: If you're using Silverlight and WPF, then employing the MVVM pattern can make a powerful difference to your projects, reducing code and bugs in one. This book is an invaluable resource for serious developers.

eBook
£22.99 £32.99
Paperback
£41.99
Subscription
Free Trial
Renews at £16.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF

Chapter 2. Introduction to MVVM

By Ryan Vice

In this chapter, we will introduce the Model View View Model pattern (MVVM) and help you better understand the current state of affairs of MVVM. This knowledge will lay a foundation that we will expand on throughout this book, to give you the tools and knowledge you need to take advantage of the many benefits of MVVM.

We will start with a brief history of the MVVM pattern, and then we will look at the structure of MVVM. Next, we will take a look at the features of WPF and Silverlight that make MVVM such an attractive option and follow this by diving into our first MVVM sample. Next, we will look at the benefits of using MVVM and discuss how we capitalized on those benefits in the MVVM sample that we built. We will follow this by looking at the challenges that can make MVVM difficult; addressing these challenges with various tools and techniques will be covered in the later chapters of this book and will make up a large majority of this book's...

History


MVVM is a pattern that emerged to address some of the limitations of MVC and MVP, and to combine some of their strengths. This pattern first hit the scene as a part of Small Talk's framework, under the name Application Model, in the '80s, and was later improved and given the updated name of Presentation Model.

Note

Application Model is also used to describe a hierarchical way of implementing MVVM, which will be covered in Chapter 6, Northwind—Hierarchical View Model and IoC

In the previous chapter, we reviewed a few shortcomings of MVC and how it dealt with view state and view logic, including the following:

  • The view logic and view state were in the view and therefore difficult to test

  • The view state and view logic were tightly coupled to the model and controller and were not reusable

These issues were addressed in the Passive View version of MVP by making the view a humble view and moving the view state and view logic into an external class.

Note

A humble view is a type of humble object...

Structure


With MVVM comes the concept of purity which refers to the amount of code in the code-behind. Here, we will be focusing on the pure approach—the style where no code is kept in the code-behind, and no references are kept between the view and view model.

Note

We will be covering varying degrees of purity, and the tradeoffs of each, in Chapter 4, Northwind—Services and Persistence Ignorance. However, if you are not interested in following the pure approach, you will still benefit from the material from this section, as it introduces the basic MVVM structure and sets up the design that will be used in our first example that will come later in this book.

Pure MVVM

Pure MVVM is structured as shown in the following diagram:

This structure is similar to MVP, except that there is no longer the IView interface for communicating from presenter to view. All communications between view and view model are now handled using WPF's and Silverlight's binding systems.

In MVVM, the model takes on the...

WPF and Silverlight enablers


.NET 3.0 introduced new toolkits for thick and thin client development, which included Silverlight for thin client development and Windows Presentation Foundation (WPF) for thick client development. At the heart of these new frameworks were features that allowed for much greater separation of concerns, including the following:

  • A rich data binding system

  • A commanding infrastructure

  • Support for data templates

  • A rich styling system

We will cover these features shortly, but for now it's important to know that these features in WPF and Silverlight made MVVM a practical reality as it provided the framework support needed for separating the view state and view logic from the view without requiring the overhead of writing property objects or using view interfaces.

There are many areas in the framework that could be improved to better support MVVM, and my guess would be that we will be seeing the road map for WPF and Silverlight incorporate more of the techniques and tools...

MVVM project billing sample


Now we will implement project billing using the MVVM pattern. Let's start by discussing the overall design.

MVVM design

The model, view, and view model are shown in the following screenshot, along with their relationships:

The view is now empty, and all of the explicit relationships that we've created between our classes are between the model and view model.

View Models

We will need two view models for this application. Each view model has its own area of responsibility in the view, as shown in the next screenshot.

Note

Using multiple nested view models in this way is what I call hierarchical view models, and it is a topic that will be explored in more detail in Chapter 6, Northwind Hierarchical View Model and IoC.

ProjectsViewModel

The ProjectViewModel view model will contain the view state and view logic for ProjectsView. The following screenshot shows the mapping between Projects and ProjectsViewModel:

The property bindings and their responsibilities are shown as...

Benefits of MVVM


MVP had been the dominant presentational pattern for most UI development, with MVC still having a strong presence in web UIs before .NET 3.0 introduced some new technologies that made MVVM or Presentation Model an attractive option for WPF and Silverlight.

The benefits of MVVM include the following:

  • Increased testability: Testability is improved as all view logic is now easily testable from unit tests.

  • Less code: I've found that the amount of code required to manage the view has decreased quite a bit, as you no longer have to deal with boilerplate code behind code. This code involves a lot of casting and error checking in production quality code. Less code means fewer bugs, less code to maintain, and fewer unit tests to write.

  • Increased decoupling: When using the pure approach, you no longer need to have the view and mediator (view model, presenter, or controller) be explicitly aware of each other. The view does have a reference to the view model via its DataContext property...

Issues and pain points of MVVM


There are some issues and pain points to implementing MVVM which include the following:

  • Lack of direction from Microsoft: Microsoft hasn't given clear directions on this pattern yet, and the various non-Microsoft resources available on the topic can send mixed messages, leaving developers and architects confused.

  • Need for boilerplate code, complicated techniques and/or frameworks: There are many areas in WPF and Silverlight where MVVM support can be improved. Things like property changed notifications and commands require lots of boilerplate code and potentially brittle designs that require using "magic strings". There are many frameworks and techniques out there that help address these issues. However, you may not want to or may not be allowed to use open source frameworks. Also, implementing the techniques that allow you to avoid using the frameworks can be complicated and require a good bit of boilerplate code to implement, as you will see later in this...

MVVM Light


There are many great MVVM frameworks out there, and we review many of them in Appendix A, but throughout this book we will be using the MVVM Light toolkit by Laurent Bugnion and GalaSoft. The toolkit is available for free on Code Plex (http://mvvmlight.codeplex) and offers many features, including:

  • A lean framework that offers only what is needed for MVVM

  • Project templates for both WPF and Silverlight, in both Visual Studio and Blend

  • Blendability support is written into the templates

  • Service locator pattern is written into the templates

  • Item templates for Visual Studio and Blend

    • Create a new view model

    • Create a new view

    • Create a new view model locator, a class that holds and manages references to view models

  • Code snippets to help increase productivity when implementing MVVM

    • mvvminpc adds a new bindable property to a view model

    • mvvmlocatorproperty adds a new view model to a view mode locator

    • mvvmpropa adds a new attached property to a dependency object (WPF only)

    • mvvmpropdp adds a new...

Summary


In this chapter, we got our feet wet with MVVM. We started things off with a quick review of the history of the pattern and its basic structure. We then covered the technologies in WPF and Silverlight that enable MVVM. Next, we built a version of the Project Billing sample application using MVVM and followed this by looking at the benefits of the pattern. We talked briefly about some of the issues and pain points with implementing MVVM and then finished off the chapter by looking at the MVVM Light toolkit that we will use later in this book.

Left arrow icon Right arrow icon

Key benefits

  • Build an enterprise application using Silverlight and WPF, taking advantage of the powerful MVVM pattern, with this book and e-book
  • Discover the evolution of presentation patternsóby exampleóand see the benefits of MVVM in the context of the larger picture of presentation patterns
  • Customize the MVVM pattern for your projects' needs by comparing the various implementation styles

Description

MVVM (Model View View Model) is a Microsoft best practices pattern for working in WPF and Silverlight that is highly recommended by both Microsoft and industry experts alike. This book will look at the reasons for the pattern still being slow to become an industry standard, addressing the pain points of MVVM. It will help Silverlight and WPF programmers get up and running quickly with this useful pattern.MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF will help you to choose the best MVVM approach for your project while giving you the tools, techniques, and confidence that you will need to succeed. Implementing MVVM can be a challenge, and this book will walk you through the main issues you will come across when using the pattern in real world enterprise applications.This book will help you to improve your WPF and Silverlight application design, allowing you to tackle the many challenges in creating presentation architectures for enterprise applications. You will be given examples that show the strengths and weaknesses of each of the major patterns. The book then dives into a full 3 tier enterprise implementation of MVVM and takes you through the various options available and trade-offs for each approach. During your journey you will see how to satisfy all the demands of modern WPF and Silverlight enterprise applications including scalability, testability, extensibility, and blendability.Complete your transition from ASP.NET and WinForms to Silverlight and WPF by embracing the new tools of these platforms, and the new design style that they allow for. MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF will get you up to speed and ready to take advantage of this powerful new presentation platform.

Who is this book for?

This book will be a valuable resource for Silverlight and WPF developers who want to fully maximize the tools with recommended best practices for enterprise development. This is an advanced book and you will need to be familiar with C#, the .Net framework, and Silverlight or WPF.

What you will learn

  • Maximize separation of concerns by taking advantage of WPF and Silverlight s rich binding system, templates, and commanding infrastructure
  • Discover the built-in support for MVVM in Entity Framework and WCF
  • Create unit testable user interfaces the MVVM way
  • Work in parallel with minimal dependencies by creating blendable architectures
  • Solve common MVVM problems both with and without frameworks depending on your preference
  • Extend your architecture and test it by using inversion of control frameworks
  • Tackle complex designs by using hierarchical view model design and mediators
  • Reduce the amount of code in your user interface by letting the WPF and Silverlights binding system eliminate your need to do things like casting controls and dispatching
  • Best practices for dealing with collections
  • Create designs that allow for dramatically changing your user interface without having to change code outside the view using data templates
Estimated delivery fee Deliver to Great Britain

Standard delivery 1 - 4 business days

£4.95

Premium delivery 1 - 4 business days

£7.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 03, 2012
Length: 490 pages
Edition : 1st
Language : English
ISBN-13 : 9781849683425
Vendor :
Microsoft
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Great Britain

Standard delivery 1 - 4 business days

£4.95

Premium delivery 1 - 4 business days

£7.95
(Includes tracking information)

Product Details

Publication date : Aug 03, 2012
Length: 490 pages
Edition : 1st
Language : English
ISBN-13 : 9781849683425
Vendor :
Microsoft
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£16.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
£169.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts
£234.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total £ 90.98
Windows Presentation Foundation 4.5 Cookbook
£48.99
MVVM Survival Guide for Enterprise Architectures in Silverlight and WPF
£41.99
Total £ 90.98 Stars icon
Banner background image

Table of Contents

11 Chapters
Presentation Patterns Chevron down icon Chevron up icon
Introduction to MVVM Chevron down icon Chevron up icon
Northwind – Foundations Chevron down icon Chevron up icon
Northwind—Services and Persistence Ignorance Chevron down icon Chevron up icon
Northwind—Commands and User Inputs Chevron down icon Chevron up icon
Northwind—Hierarchical View Model and IoC Chevron down icon Chevron up icon
Dialogs and MVVM Chevron down icon Chevron up icon
Workflow-based MVVM Applications Chevron down icon Chevron up icon
Validation Chevron down icon Chevron up icon
Using Non-MVVM Third-party Controls Chevron down icon Chevron up icon
MVVM Application Performance Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.6
(14 Ratings)
5 star 35.7%
4 star 7.1%
3 star 35.7%
2 star 21.4%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




David Mar 05, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book acknowledges the plethora of contradictory, even misleading, generally available information on using MVVM with WPF (I don't use Silverlight). Against this background, its objective approach helped clarify my thoughts, so that I am delighted with what I have been able to put into practice.A few other reviews have mentioned the number of external references to topics that are out of scope. I bought the book specifically to address MVVM/WPF integration, so I have not minded them at all. For me, it has a specific focus for which it caters admirably.
Amazon Verified review Amazon
AmazonCustomer Aug 17, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've owned this book for several years now and have implemented MVVM in real world WPF projects.The first few chapters explain why you'd actually want to use MVVM by contrasting the pattern with predecessor UI patterns using several code based example. This provides a solid and convincing justification for the pattern.The author then then goes on to build a more substantial application conforming to industry best practices and explaining his choices throughout.I was initially skeptical of the use of the MVVM lite library but when it came to the reality of implementing an MVVM project without MVVM lite you'l be forced to either write your own version of the libraries functionality so you might as well use it.Its a shame the author mentions Silverlight first in the title because that dead tech will probably put people off but there is very little Silverlight this is a solid WPF book.
Amazon Verified review Amazon
B. Henry Dec 21, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good stuff
Amazon Verified review Amazon
Evil J Oct 25, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Lots of words have been written about MVC, MVP, and MVVM among other programming patterns and how they are all designed to help the developer create applications quicker that are more maintainable. If you are working in XAML with WPF or Silverlight, then MVVM is the defacto standard for application development. What I appreciated in this book was that this is the assumption that is made and it isn't an apologetics title on why you should pick MVVM as your design pattern. I hate when a book spends the first half trying to sell me on the pattern... I'm already committed to it that is why I buy the title! The authors here recognize that and don't waste my time trying to convince me why I should be using the pattern.The book starts out with a bit of history by talking about monolithic application design and walks the reader down memory lane touching on RAD, MVC, MVP, and finally bringing us to MVVM. I thought that was really cool. For someone not familiar with this heritage, it is good to learn it as it gives some context about MVVM and how we got here. What I also thought was good is that the same example application is used to describe each model with a discussion of how the application would be implemented under that model. That really highlights the differences and helps the reader understand the drive towards MVVM.But let's face it; this book is about MVVM and how to successfully use it in 3-tier applications at an enterprise-ready level. And that is important... because it means the details are there to help the developer identify the dark corners of application development that take an effort from average to enterprise. (The book covers WF and workflows... In an MVVM book! That is how detailed it is!)At over 450 pages, the book is crammed full of useful information. The reader is literally walked-through the design and development of a 3-tier enterprise application as each chapter introduces a new concept building on the previous one to add layer after layer of functionality. Along the way, all the challenges of complex application development are covered as well as how to structure for maintainability. The pain points in MVVM are talked about where applicable as well as ways to mitigate that pain. I've been writing apps in the MVVM pattern for years and I was still able to get a lot from this book.Is this for absolute beginners? Maybe not... things move fast and tackling a big app right out of the gate is probably a setup for failure. But for someone that has some familiarity with C#, WPF, and/or Silverlight (and MVVM or even MVC/MVP) this book will be great. I found that I was relying on some of my knowledge from outside the book to help understand and grasps the concepts inside the book but I chalk that up to just the fact that MVVM and enterprise application development are complex topics. It is impossible to present every facet of knowledge in one place. Plus, even though the pattern is well defined, there is a lot of wiggle room and space for interpretation.Overall, I think that for people working in WPF or Silverlight and that know some MVVM, even at a beginner level; this book will give them tons of useful information. Even if, like me, you've been doing it for a while, I think there is still a lot of information to gain. I have gone back a few times to refer to a section while working on projects. I've had this book for just over 2 months now and it has proven to be a great guide to getting deep with MVVM and then again as a reference to help refresh my memory as I tackle projects.
Amazon Verified review Amazon
Alfredo Sep 13, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The job of the reader is to understand what the presentation design patterns define with respect to purpose and principles and how technologies and real world environments can enhance or limit the purpose without violating the principles. While the name of the game is facilitation of development via SoC, performance improvements can be gained with the use of the right design and complementary technologies.This book really covers all the relevant topics, most are discussed in detail and some are just alluded to for further investigation. The authors show you one way of doing something, and then improve upon it later. This is a book designed to teach students (very heavy on the sample code), not to tell experienced developers what they already know. It would actually serve as a great syllabus in a course.Chapter 1 tackles the monolithic approach but it also criticizes the RAD approach. If one didn't know better you'd think RAD was always the way to go, so I'm happy to see it brought down a notch. MVC and MVP are historically examined and differentiated but not bashed; the benefits and limitations are simply put out there. They don't muddy the waters with too much MVVM up front. Takeaway sections can be referenced if you begin to second guess your design pattern of choice.Chapter 2 makes it clear why MVC's strong presence is due primarily to the lack of web client technologies with strong declarative binding support (with the presence of frameworks such as KnockoutJS and AngularJS, the MVVM pattern is gaining wider support). Supporting patterns such as Property Object and Command are introduced along with their technical implementations and from what need they arose.Chapter 3 can be quickly skimmed if you don't intend to implement the ongoing sample project.While in Chapter 4 I was surprised to not find the phrase "RIA Services" in the entire book. This was such a good decision, it is much better left to another book entirely; any brief samples would only be confusing. This chapter has a lot of value in terms of putting you in the right frame of mind regarding persistence ignorance; it just tends to force you into a UoW pattern, which is good. But I don't see too much value in DDD over Table Module for your data object model since for the most part your data object model will mimic the database tables. I thought DDD was for your logical entities... yet nevertheless the authors' advice is applicable in principle.In Chapter 5, the use of attached behaviors to map multiple control events to one or more commands is impressive.Chapter 6 left me with a bitter taste in that I consider the View Model to be the context of a View, AKA "Region" of the page, synonymous with an ASP.NET user control. I don't consider the View Model to be a context for Data Templates. That's equivalent to saying that each item in a listbox is a View, that's why it's called a DATA Template, and listboxes have ITEM Templates, not VIEW Templates. I don't like the great gap in scope between a classic View and a View for each item in a collection. I am accustomed to exposing data objects directly to Data Templates, as collection properties on the View Model. View Models contain and represent much more than just database records, a View Model:* contains cross data entity business rules related to the View* communicates with other View Models (Event Aggregation) to enforce cross View business rules* defines commands to object context logic* is not a database record (which for the most part are only objects because that's how .NET works, they are more relationally defined than object oriented)* maps to one or more logical entities that provide its functionality* pulls together multiple data objects into a well prepared context for a View* is not a data objectThe authors do not contrast the difference between a data model and a logical object model. Take a Product Manager class as opposed to a Product class, their purpose couldn't be more different and only one gets persisted. How often do you have a data object that serves as the entire context of a classic View? It's typically a collection for a list control or two with surrounding menu context, so the argument that the View Model would require the data model's properties to be redundantly defined on it, isn't considering that it's usually only exposing a couple of collections.If you wouldn't think to navigate to a View or establish it as a named region, then it doesn't need a View Model.If you understand my point of view as well as the authors', then you're on the right path, regardless of which approach you choose to implement.Chapter 7 will save you lots of time on the learning curve, as any WPF or Silverlight purest will tell you.Chapter 8 was very interesting since I've spent a lot of time trying to figure out how WF fit with a MVVM style application. The more you play with it the more you realize that your application probably doesn't even need it (it fits best in an automated distributed system), although it's good to know it's there if you do. The absolute lack of guidance from Microsoft on this subject is depressing.Chapter 9 is excellent. Validation is validation but with so many options you want to know how to pick the appropriate approach.Chapters 10, and 11 are pretty much what they say they are, but you're getting into the fringe.It's too bad custom controls weren't discussed in any detail, since the MVVM pattern applies just as well, and offers the chance to highlight the theoretical aspects of MVVM in a much more compact scenario.If you're relatively new to WPF and Silverlight using the MVVM pattern, please realize there are supporting patterns, principles, and frameworks that make it practically possible. Chapters 4, 5 and 6 are the theoretical meat of this book, re-read them if necessary. You don't have to memorize patterns and principles, just develop a list of questions to ask yourself in the design phase.Writing testable code often automatically has you asking all the right questions, which BTW this book does a superb job of doing.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela