Common Data Modeling Problems in Software

Printer Code 128 Code Set A in Software Common Data Modeling Problems
8
Generating Code 128 Code Set B In Visual C#
Using Barcode creator for .NET Control to generate, create Code 128B image in .NET applications.
Common Data Modeling Problems
Code128 Maker In .NET
Using Barcode printer for ASP.NET Control to generate, create Code 128B image in ASP.NET applications.
FIGURE 81 The original Customers entity for Mountain View Music
Code 128C Generator In .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 128 Code Set B image in .NET applications.
Notice the seemingly duplicate address data In the strictest sense of the word this data isn t really duplicate data it contains work information versus home information but the type of data is redundant We were told during requirements gathering that Mountain View needed to store at least two addresses for each customer and that the home and the work addresses were the most common addresses on file Storing the data in the way that we have in Figure 81 presents a few problems The first problem is that the model is not flexible If we need to store additional addresses later, we would not be able to do so without first modifying the entity to add columns Second, the data is difficult to retrieve in this state Applications would need to be written to understand the complexity and pull data from the correct columns This problem is compounded by the changes that would need to be made to the application if we later add a third address This is a clear example of having too few entities, and we can tell that by the duplication of information The fix here is to give the duplicate data its own entity and establish a relationship with the original entity In Figure 82 we have split the address data into its own entity
Make Code 128A In Visual Basic .NET
Using Barcode maker for VS .NET Control to generate, create Code128 image in .NET framework applications.
Entity Problems
DataMatrix Scanner In .NET Framework
Using Barcode reader for .NET Control to read, scan read, scan image in .NET applications.
FIGURE 82 The Customers entity with the address data correctly split out As you can see, the new entity has each address attribute only once, and we have added a new attribute called Description The description allows Mountain View to identify the address at the time of entry Splitting the address data out of the customer entity in this way allows for more flexibility and eliminates the need to change the application or the data model later With this model, the company is no longer limited to only a home and a work address; it can now enter as many as it likes Maybe the customer has two houses or wants to ship something as a gift Either way, our new model allows it This kind of thing can happen often when you are building a model You mistake what should be a second entity for attributes of the entity you are building This error isn t limited to things like addresses, which are attributes of customers It can also happen with two completely different items that end up in the same entity For example, suppose we re storing data about classes at a local college If we create a Class entity, we need to track the professor for each class The quick and might we say, sloppy way is to add a few attributes to the Class entity to track the information about the professor, as shown in Figure 83
Generate Barcode In Visual Basic .NET
Using Barcode encoder for .NET Control to generate, create barcode image in Visual Studio .NET applications.
FIGURE 83 A Class entity that also contains Professor information
Barcode Drawer In Java
Using Barcode encoder for Java Control to generate, create barcode image in Java applications.
8
EAN-13 Supplement 5 Decoder In .NET Framework
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
Common Data Modeling Problems
Bar Code Reader In Java
Using Barcode reader for Java Control to read, scan read, scan image in Java applications.
By adding attributes for the professor s name, phone number, and e-mail address, we meet the requirements of the Class entity; that is, we are tracking the class s professor However, if you look below the surface, you should see some glaring problems The biggest problem is that this setup violates the rules of first normal form and all that goes with it We have not successfully separated our entities into distinct groups of information We are storing both class and professor data in the same entity In these situations, you need to split the entity along 1NF guidelines Figure 84 shows the appropriate way to store this information
Code 3 Of 9 Creator In .NET
Using Barcode printer for .NET framework Control to generate, create Code 39 Extended image in Visual Studio .NET applications.
FIGURE 84 The Class entity with the professor information moved to a new
Code 3 Of 9 Encoder In Java
Using Barcode creation for Java Control to generate, create Code 39 image in Java applications.
Professor entity
Encode EAN 128 In Java
Using Barcode creation for Java Control to generate, create EAN / UCC - 13 image in Java applications.
As you are building models or reviewing existing models, keep an eye out for these types of situations We all want our data models to be simple and easy to understand, but don t oversimplify Remember that the things you are modeling have some level of complexity, and as a rule your model should not be less complex than real life Having a lot of entities doesn t necessarily lead to a confusing model, so don t be afraid to include all the entities you need to build an accurate representation of real life
Barcode Creation In Visual Studio .NET
Using Barcode maker for Visual Studio .NET Control to generate, create barcode image in Visual Studio .NET applications.
Data Matrix 2d Barcode Drawer In Visual Basic .NET
Using Barcode creation for VS .NET Control to generate, create Data Matrix 2d barcode image in Visual Studio .NET applications.
EAN-13 Generation In Java
Using Barcode generation for Java Control to generate, create EAN / UCC - 13 image in Java applications.
Code 39 Drawer In C#
Using Barcode printer for VS .NET Control to generate, create Code-39 image in .NET framework applications.
Decoding Bar Code In .NET
Using Barcode recognizer for .NET Control to read, scan read, scan image in .NET framework applications.