Home > Articles > Programming > Windows Programming

Reflection: Browsing Code Information, Part 2

Reflection is used in the process of obtaining type information at runtime. In this three-part series, Kevin Burton discusses the concept of reflection, which (among many other things) allows you to browse for information about any particular piece of code.
This second of three articles is excerpted from .NET Common Language Runtime Unleashed (Sams, 2002, ISBN: 0672321246).
This chapter is from the book

One of the most prominent uses for reflection is serialization. Serialization is the process of turning an object into a stream of bytes that can be stored or transferred "elsewhere" and then used to reconstruct the object. You obviously cannot take an existing object and directly transfer it to another machine and expect it to work. Certain addresses and handles only correspond to memory on one machine or, for that matter, one process. In the past, MFC had a facility whereby an object could serialize and deserialize itself. The programmer decided which fields needed to be serialized through the code. Using reflection, it was possible to assist the programmer in serializing an object. The programmer no longer needed to depend on intimate knowledge of an object's format to serialize it. In addition, if the object changed, it would automatically serialize in a correct manner without the need to change the code that references it.

Although an object can be serialized in many formats, the predominant format used for objects that are to be passed between disparate systems is XML. (Remoting opens the possibility of transferring data as a binary stream, which is much faster, but it is not very portable or compatible with other machines.) XML is the format that this article will primarily focus attention toward in discussing serialization.

The .NET Framework uses two types of serialization (binary serialization and SoapRpc serialization used with ASP.NET and Web applications have been excluded): one used for remoting and one used for "manual" serialization directly to XML. Although both of these serialization methods use XML as the underlying format, remoting uses a specific dialect of XML known as Simple Object Access Protocol (SOAP).

Serialization Used in Remoting

To demonstrate SOAP serialization that is used in remoting, consider the following code in Listings 1–3.

Listing 1—Building a Vehicle List

public class VehicleBuilder
{
  public Vehicle Vehicle(string licenseNumber) 
  {
    if (licenseNumber == "0") 
    {
      Vehicle v = new Car();
      v.licenseNumber = licenseNumber;
      v.make = DateTime.Now;
      return v;
    }
    else if (licenseNumber == "1") 
    {
      Vehicle v = new Bike();
      v.licenseNumber = licenseNumber;
      v.make = DateTime.Now;
      return v;
    }
    else 
    {
      return null;
    }
  }
}

This is simply a utility class that allows you to easily build a vehicle based on the license number passed in ("0" is for a car, "1" is for a bike). Listing 2 shows the actual implementation of vehicle, car, and bike.

Listing 2—Defining a Vehicle

[Serializable]
public abstract class Vehicle 
{
  public string licenseNumber;
  public DateTime make;
}
 
[Serializable]
public class Car : Vehicle 
{
}
 
[Serializable]
public class Bike : Vehicle 
{
}

Notice that all that is needed to serialize the object is to indicate that the object is serializable with the [Serializable] attribute. Vehicle is abstract to show that the serialization services can deal with polymorphism. That is all you have to do. Listing 3 shows a possible test.

Listing 3—Testing Serialization

public class VehicleSerializationTest
{
  public static int Main(string[] args)
  {
    VehicleBuilder vb = new VehicleBuilder();
    Vehicle [] va = new Vehicle[2];
    va[0] = vb.Vehicle("0");
    va[1] = vb.Vehicle("1");
    // Create an instance of the Soap Serializer class;
    // specify the type of object to serialize.
    Stream stream = File.Create("out.xml");
    SoapFormatter soap = new SoapFormatter();
    soap.Serialize(stream, va);
    stream.Close();
    stream = File.OpenRead("out.xml");
    va = (Vehicle [])soap.Deserialize(stream);
    stream.Close();
    Console.WriteLine("The first item is: {0}", va[0]);
    Console.WriteLine("The second item is: {0}", va[1]);
    return 0;
  }
}

The first task is to build up an array of Vehicles. Because of the license number passed in the first (va[0]), Vehicle is a Car and the second is a Bike. Next, you open up (Create) a file called out.xml. Using the SoapFormatter class, you serialize the Vehicle Array out to the file. It is not important, but it is interesting to look at what the format of the output file looks like:

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:a1="http://schemas.microsoft.com/clr
   /nsassem/VehicleSerialization/VehicleSoap">
 <SOAP-ENV:Body>
  <SOAP-ENC:Array SOAP-ENC:arrayType="a1:Vehicle[2]">
    <item href="#ref-3"/>
    <item href="#ref-4"/>
  </SOAP-ENC:Array>
  <a1:Car id="ref-3">
    <licenseNumber id="ref-5">0</licenseNumber>
    <make>2001-08-21T17:46:22.1585-05:00</make>
  </a1:Car>
  <a1:Bike id="ref-4">
    <licenseNumber id="ref-6">1</licenseNumber>
    <make>2001-08-21T17:46:22.1585-05:00</make>
  </a1:Bike>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

From this file, you can see that it created a Vehicle array with two Vehicles in it (arrayType="a1:Vehicle[2]"). SOAP creates two items referring to "#ref-3" and "#ref-4." Notice that "#ref-3" refers to a Car and "#ref-4" refers to a Bike (id="ref-3" and id="ref-4" respectively).

Go back to the sample in Listing 3. After the Vehicle array is serialized, then the file is immediately opened again and SoapFormatter deserializes the contents of the file, producing the Vehicle array again. Finally, each item is printed to the Console to verify that it was properly deserialized. The output looks like this:

The first item is: VehicleSerialization.Car
The second item is: VehicleSerialization.Bike

You got back exactly what you put in.

The next example shows how the serializer can descend multiple levels of an object graph. Portions of the code will be shown in Listings 4 and 5. The full source for this sample is in Serialization\Multilevel\MultilevelSoap and is part of the solution in Serialization\Multilevel. You start out with a definition of the classes involved in Listing 4.

Listing 4—A Family Organization

[Serializable]
public class Person
{
  public string name;
  public double age;
}

[Serializable]
public class Marriage
{
  public Person husband;
  public Person wife;
}

[Serializable]
public class Family
{
  public Marriage couple;
  public Person [] children;
}

As you can see, this organization nests one class in another. This will test to see if you can maintain this structure when serializing and deserializing. Listing 5 shows the test used to exercise this serialization.

Listing 5—Building and Testing a Family Organization

public static int Main(string[] args)
{
  Person me = new Person();
  me.age = 43;
  me.name = "Kevin Burton";

  Person wife = new Person();
  wife.age = 50;
  wife.name = "Becky Burton";

  Marriage marriage = new Marriage();
  marriage.husband = me;
  marriage.wife = wife;

  Family family = new Family();
  family.couple = marriage;

  family.children = new Person[4];
  family.children[0] = new Person();
  family.children[0].age = 20;
  family.children[0].name = "Sarah";
  family.children[1] = new Person();
  family.children[1].age = 18;
  family.children[1].name = "Ann Marie";
  family.children[2] = new Person();
  family.children[2].age = 17;
  family.children[2].name = "Mike";
  family.children[3] = new Person();
  family.children[3].age = 13;
  family.children[3].name = "Rose";
  Stream stream = File.Create("out.xml");
  SoapFormatter soap = new SoapFormatter();
  soap.Serialize(stream, family);
  stream.Close();

  Console.WriteLine(family.couple.husband.name);
  Console.WriteLine(family.couple.wife.name);
  foreach(Person p in family.children)
  {
    Console.WriteLine(p.name);
  }

  Console.WriteLine("----------");

  stream = File.OpenRead("out.xml");
  soap = new SoapFormatter();
  family = (Family)soap.Deserialize(stream);
  stream.Close();
    Console.WriteLine(family.couple.husband.name);
  Console.WriteLine(family.couple.wife.name);
  foreach(Person p in family.children)
  {
    Console.WriteLine(p.name);
  }

  return 0;
}

The serialized output looks like this:

SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
   SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:a1="http://schemas.microsoft.com/clr/nsassem/MultiLevel/
   MultiLevelSoap">
<SOAP-ENV:Body>
 <a1:Family id="ref-1">
  <couple href="#ref-3"/>
  <children href="#ref-4"/>
 </a1:Family>
 <a1:Marriage id="ref-3">
  <husband href="#ref-5"/>
  <wife href="#ref-6"/>
 </a1:Marriage>
 <SOAP-ENC:Array id="ref-4" SOAP-ENC:arrayType="a1:Person[4]">
  <item href="#ref-7"/>
  <item href="#ref-8"/>
  <item href="#ref-9"/>
  <item href="#ref-10"/>
 </SOAP-ENC:Array>
 <a1:Person id="ref-5">
  <name id="ref-11">Kevin Burton</name>
  <age>43</age>
 </a1:Person>
 <a1:Person id="ref-6">
  <name id="ref-12">Becky Burton</name>
  <age>50</age>
 </a1:Person>
 <a1:Person id="ref-7">
  <name id="ref-13">Sarah</name>
  <age>20</age>
 </a1:Person>
 <a1:Person id="ref-8">
  <name id="ref-14">Ann Marie</name>
  <age>18</age>
 </a1:Person>
 <a1:Person id="ref-9">
  <name id="ref-15">Mike</name>
  <age>17</age>
 </a1:Person>
 <a1:Person id="ref-10">
  <name id="ref-16">Rose</name>
  <age>13</age>
 </a1:Person>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The output from the program looks like this:

Kevin Burton
Becky Burton
Sarah
Ann Marie
Mike
Rose
----------
Kevin Burton
Becky Burton
Sarah
Ann Marie
Mike
Rose

As was expected, what you put in is what you got out.

XML Serialization

To demonstrate XML serialization, or more precisely, serialization using System.Xml.Serialization, you will use the same classes that you used in the previous section. To start out, you will look at how the Vehicle class is serialized. Compare this implementation with the implementation described in Listings 1–3. Portions of the code will be shown in Listings 6–8. The full source to this sample is in Serialization\Vehicle\VehicleXml and is part of the solution in Serialization\Vehicle.

You will begin by generating a Vehicle array. No changes are required to the VehicleBuilder class, so for this sample, assume that you are using the same code as in Listing 1. Listing 6 shows how little is changed from the previous section.

Listing 6—Vehicles Marked for Serialization

[XmlInclude(typeof(Car)), XmlInclude(typeof(Bike))]
public abstract class Vehicle 
{
  public string licenseNumber;
  public DateTime make;
}

public class Car : Vehicle 
{
}
 
public class Bike : Vehicle 
{
}

If you did not want to serialize an abstract class, you could have just removed the [Serializable] attribute from the classes and that would be all that needed to be done. As it is, you need to add an [XmlInclude] attribute; otherwise, the XmlSerializer gets confused when trying to serialize a Vehicle array. Listing 7 shows the test program.

Listing 7—Testing Vehicle Serialization with XmlSerializer

public static int Main(string[] args)
{
  VehicleBuilder vb = new VehicleBuilder();
  Vehicle [] va = new Vehicle[2];
  va[0] = vb.Vehicle("0");
  va[1] = vb.Vehicle("1");

  // Create an instance of the XmlSerializer class;
  // specify the type of object to serialize.
  XmlSerializer serializer = 
    new XmlSerializer(typeof(Vehicle[]));
  StreamWriter streamWriter = new StreamWriter("out.xml");
  serializer.Serialize(streamWriter, va);
  streamWriter.Close();

  StreamReader streamReader = new StreamReader("out.xml");
  va = (Vehicle [])serializer.Deserialize(streamReader);
  streamReader.Close();

  Console.WriteLine("The first item is: {0}", va[0]);
  Console.WriteLine("The second item is: {0}", va[1]);

  return 0;
}

Just like before, you create a Vehicle array first. Then instead of using a SoapFormatter, you use XmlSerializer. The Vehicle array is serialized to "out.xml". This file now looks like this:

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfVehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <Vehicle xsi:type="Car">
  <licenseNumber>0</licenseNumber>
  <make>2001-08-21T22:04:59.2750080-05:00</make>
 </Vehicle>
 <Vehicle xsi:type="Bike">
  <licenseNumber>1</licenseNumber>
  <make>2001-08-21T22:04:59.2750080-05:00</make>
 </Vehicle>
</ArrayOfVehicle>

This is a little more readable than the SOAP version, but the same information is contained here. It has been said that programmatic types dominate serialization in System.Runtime.Serialization, which is used by remoting. In other words, the serialization scheme used for System.Runtime.Serialization is more centered in CLR types than in XML types if a conflict exists. With serialization using System.Xml.Serialization, the focus is more on XML types. A little of that bias can be seen in the requirement to use [XmlInclude] when serializing an abstract class. More importantly, using the attributes associated with System.Xml.Serialization gives the programmer a great deal of flexibility in mapping between CLR types and XML types.

This mapping is achieved by using an optional tool called the XML Schema Design Tool (xsd.exe). If the preceding vehicle class was put into a library (VehicleLibrary.dll), then you could run xsd.exe on the library like this:

xsd VehicleLibrary.dll

This would generate a file 'schema0.xsd' that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"
   xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="Vehicle" nillable="true" type="Vehicle" />
 <xs:complexType name="Vehicle" abstract="true">
  <xs:sequence>
   <xs:element minOccurs="0" maxOccurs="1" name="licenseNumber"
   type="xs:string" />
   <xs:element minOccurs="1" maxOccurs="1" name="make"
   type="xs:dateTime" />
  </xs:sequence>
 </xs:complexType>
 <xs:complexType name="Automobile">
  <xs:complexContent mixed="false">
   <xs:extension base="Vehicle" />
  </xs:complexContent>
 </xs:complexType>
 <xs:complexType name="Bicycle">
  <xs:complexContent mixed="false">
   <xs:extension base="Vehicle" />
  </xs:complexContent>
 </xs:complexType>
 <xs:element name="Car" nillable="true" type="Car" />
 <xs:element name="Bike" nillable="true" type="Bike" />
</xs:schema>

This schema can be used to validate the XML coming into the system and that was generated by XmlSerializer. Because the sample that is shown both generates the XML and generates the schema as well, it is difficult to show the significance.

Suppose that the XML document must have the tags "Car" and "Bike" changed to "Automobile" and "Bicycle." In that case, you would just need to modify the Vehicle class:

[XmlType("Automobile")]
public class Car : Vehicle 
{
}
 
[XmlType("Bicycle")]
public class Bike : Vehicle 
{
}

Now the XML that is generated by the XmlSerializer looks like this:

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfVehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <Vehicle xsi:type="Automobile">
  <licenseNumber>0</licenseNumber>
  <make>2001-08-21T23:04:57.6792592-05:00</make>
 </Vehicle>
 <Vehicle xsi:type="Bicycle">
  <licenseNumber>1</licenseNumber>
  <make>2001-08-21T23:04:57.6792592-05:00</make>
 </Vehicle>
</ArrayOfVehicle>

If the xsd.exe tool were run on the same library, it would generate the following:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified"
   xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="Vehicle" nillable="true" type="Vehicle" />
 <xs:complexType name="Vehicle" abstract="true">
  <xs:sequence>
   <xs:element minOccurs="0" maxOccurs="1" name="licenseNumber"
   type="xs:string" />
   <xs:element minOccurs="1" maxOccurs="1" name="make"
   type="xs:dateTime" />
  </xs:sequence>
 </xs:complexType>
 <xs:complexType name="Automobile">
  <xs:complexContent mixed="false">
   <xs:extension base="Vehicle" />
  </xs:complexContent>
 </xs:complexType>
 <xs:complexType name="Bicycle">
  <xs:complexContent mixed="false">
   <xs:extension base="Vehicle" />
  </xs:complexContent>
 </xs:complexType>
 <xs:element name="Automobile" nillable="true" type="Automobile" />
 <xs:element name="Bicycle" nillable="true" type="Bicycle" />
</xs:schema>

Now the schema will properly validate XML documents coming into the system, and you will generate proper XML documents. (If this requirement were imposed on you, it would be likely that the external source or destination of the document would already have a schema that you would use to generate classes). Notice that the class names (in other words, the CLR types) have not changed. The other XML attributes allow for similar flexibility in mapping CLR types to XML types.

Late Binding to an Object Using Reflection

When the compiler encounters a reference when building an assembly, it loads the referenced assemblies and uses them to resolve all of the unresolved types. However, if you don't have the reference at compile time, you will not be able to call methods. You have just seen that with the classes in System.Reflection, you can dissect any assembly and find the methods and types in the assembly. It turns out that System.Reflection provides a means whereby a call can be made to a method in an assembly that is not known at compile time. This process is known as late binding.

It might be difficult to understand the usefulness of late binding at first, but some applications are not possible without a means of late binding. What if you wanted to provide feedback to third-party software? You don't know and don't want to know what the company will be doing with this feedback, but you want to provide a means whereby you can effectively notify them. You don't know ahead of time how many notifications you will have to set up. One solution would be to have a certain directory in which the third-party software would reside. You indicate to the developers of this third-party software that if they want to receive this notification, they will have to provide a function OutputMessage that takes as a single argument a string that contains the notification message. Now all you have to do is scan the directory and find out which of the software modules (probably DLLs) have an OutputMessage method defined and call the method. Using reflection, Listing 8 shows how this might be done with the .NET Framework. The complete source for this sample is in the LateBinding directory. Also included are two subprojects that build the required "first.dll" and "second.dll." If you need to use a directory other than the two directories supplied, or if you don't want to use debug mode, you will need to change the source so that it can locate the two DLLs.

Listing 8—Late Binding Client

static void Main(string[] args)
{
  Assembly first = Assembly.LoadFrom(@"..\..\First\bin\debug\first.dll");
  Assembly second = Assembly.LoadFrom(@"..\..\Second\bin\debug\second.dll");
  Assembly [] assemblies = new Assembly[] { first, second };
  foreach(Assembly a in assemblies)
  {
    Type[] types = a.GetTypes();
    foreach(Type t in types)
    {
      try
      {
        object o = Activator.CreateInstance(t);
        MethodInfo m = t.GetMethod("OutputMessage");
        m.Invoke(o, new object [] {"This is my message"});
      }
      catch(Exception e)
      {
        Console.WriteLine(e);
      }
    }
  }
}

Notice that directory scanning code has not been included for clarity. An Assembly array is available that you can scan for the OutputMessage method. The key portion of the code is the three lines beginning with the Activator.CreateInstance call. The Activator.CreateInstance creates an instance of the type specified. Here that type will be the class containing the OutputMessage method. A search is performed for the OutputMessage method within the Type. The return for this scan is an instance of the MethodInfo class that corresponds to the OutputMessage method. The method is then called with a single string argument.

As you can imagine, late binding is pretty slow compared to compiled early bound code, but in some cases, the flexibility provided by late binding more than justifies the extra CPU cycles.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020