Apex Design Patterns by Zaa Jitendra & Verma Anshul

Apex Design Patterns by Zaa Jitendra & Verma Anshul

Author:Zaa, Jitendra & Verma, Anshul [Zaa, Jitendra]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2016-04-27T04:00:00+00:00


Continuing with our journey, Universal Call Center is implementing a products list screen, which displays a list of products with their information:

Developers design a wrapper class to display the information, as shown in the following figure:

public class ProductWrapper{ //public properties public String Name {get; set;} public String ProductCode {get; set;} public Decimal SalesPrice {get; set;} public Decimal TaxRate {get; set;} public String TaxType {get; set;} public String TaxDetails {get; set;} public Decimal TotalTax {get; set;} public String VendorName {get; set;} public String VendorShippingAddress {get; set;} public String VendorContactPhone {get; set;} public String VendorContactEmail {get; set;} //constructor public ProductWrapper(String name, String productCode){ this.Name = name; this.ProductCode = productCode; } }

In the preceding wrapper class, each instance of ProductWrapper contains product, tax, and vendor details. As the product list grows, the overall viewstate of the page also increases. The development team identifies that with this behavior, a page can easily hit viewstate limits (135 KB) and can result in an unstable functionality.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.