Long heard about WinFS, it was hard to upgrade the memory to 512 M. After Longhorn was installed in the VM, it was found that WinFS is still in a basic test phase, and many functions are limited, only one Defaultsore directory is supported and cannot be changed for the time being. All files placed in the directory will be detected and classified. For Files migrated from FAT32 or NTFS, if Meta Data, such as ID3 of MP3 files, is stored, false
If no Meta Data file exists, you can also create its Meta Data.
I copied several MP3 and WMA files from my hard disk to the hard disk of the VM.
1. Open the Computer and enter the Defaultstore.
2. I wanted to create a Music directory but encountered an error. Later I found that WinFS was in a test and could not name the items.
3. Copy the music file to the root directory of defastore store.
4. Open the Music directory in the Start Menu and click Recently Added on the left. Several new Music files are displayed.
5. Right-click and select View? Detail, and then click Genre? Stack by Genre, you can find that a music file is divided into several items based on its music type (such as Pop). Click "Item" to browse the files of this type.
6. enter pop in the Filter by input box on the left (Note: The name of a non-music file). All pop music files are displayed, rather than those hidden.
7. put some images into the Defaultstore, open the Photos and Videos directories in the Start Menu, enter 1024*768 in the Filter by field, and find that all images with a size of 1024*768 are displayed.
Here, it seems that WinFS has nothing to do, just as a file Meta Data searcher. However, it is estimated that the problem will never be as simple as I thought, so I will continue to search for information and find many interesting things.
WinFS Data Model:
WinFS is an extension of traditional file systems and relational databases. It not only stores previous file-type data, but also stores non-file-type data, such as personal information, calendars, and emails. Therefore, the units stored in WinFS should not be described by files, but should be items accurately.
First, we need to clarify several concepts: Types/Subtypes, Properties/Fields, Constraints, and Relationships.
1. Types/Subtypes
The concepts of Type and Subtype are similar to those of object-oriented classes and subclasses. The data stored in WinFS is all TYPE instances. For example, we can create an Instance with the TYPE of Person, this instance has its own attributes, such as last name, name, age, and gender. Each TYPE has its own Properties, namely Properties/Fields. Each TYPE has its own super type and Subtype. Similar to JAVA and other languages, a TYPE can only inherit from one super TYPE, but can have multiple subtypes. For example, the super types of Contact and Document are Item, the subtypes of Contact include Person, Group, and Organization, the sub-types of Document include Image and Media, and the sub-types of Image include Photo. In WinFS, several "Windows types" are pre-defined, such as Person, Message, Document, and Folder. Type can be extended, allowing users to define their own types. However, this Type of custom function is not provided in WinFS of this version.
Ii. Properties/Fields
Properties/Fields is similar to the attribute concept of a class. Each attribute can be a scalar or a structure similar to C/C ++. For a type, you can have multiple identical attributes. For example, a Person can have multiple Address attributes.
Iii. Constraints
Each Propertie/Field can have Constraints. For example, the age must be within the specified range, and the name cannot be empty. However, the currently released WinFS version does not support constraints.
Iv. Relationships
In WinFS, TYPE can be associated. Relationship is created between the source and target instances (can the source and target instances be of the same TYPE ?). Source Type instances are indispensable. Once the source type instance does not exist, the Relationship will be deleted immediately. However, a target instance can be missing. The Relationship of a target instance is called "Dangling Relationship".
For a Relationship, it can also have its own Properties/Fields like Type. For example, if a Contact has a relationship with a Message, the relationship can have a nick name attribute.
In WinFS, there are two Relationship types: Holding Relationship and Reference Relationship.
1. Holding Relationship
In this relationship, several source instances can have the same target instance. As long as the source instance still exists, the relationship exists. It also has the following features:
(1) Each instance must have more than one Holding Relationship pointing to it;
(2) instances with Holding Relationship must be
Is in the same store. (For a WinFS Item, its complete UNC namespace format is "\ machinestoresharefolder1folder2... folderNitem ");
(3) The source instance and target instance must exist at the same time, and the existence of Dangling Relationship cannot be allowed.
(4) The relationship between instances cannot form a loop, forming a Directed non-circular graph (DAG ).
(5) The Holding Relationship uses a hierarchical namespace (as shown above). Each such Relationship specifies the name of the target instance, the name of each source instance with this Relationship must be unique.
2. Reference Relationship
In this Relationship, you can allow the existence of Dangling Relationship, and allow instances to be distributed in the same store or different store. The Relationship between instances can form a loop. For example, a Document-type instance uses an author relationship to point to a contact-type instance, and this contact-type instance can also point to a Document-type instance using a reviewer relationship.
All of the above are theoretical things. I will think about how the above content is presented? In terms of operations, programming.
Under the defaultstore directory, there is a Schemas directory, and some items, such as Audio, Contact, Mail, etc., correspond to the name of the Type mentioned above. Read the documents and find that WinFS has a special Schemas Definition Language Based on XML syntax. For example, the Contact type is defined by Contact. xml. The Person is defined
<Type Name = "Person" MajorVersion = "1" MinorVersion = "0"
ExtendsType = "Core. Contact" ExtendsVersion = "1">
<Field Name = "BirthDate" Type = "WinFSTypes. datetime"
Nullable = "true" TypeMajorVersion = "1"> </Field>
<Field Name = "PersonalNames" Type = "Contact. FullName"
Nullable = "true" MultiValued = "true"
TypeMajorVersion = "1"> </Field>
<Field Name = "PersonalAddresses" Type = "Core. Address"
Nullable = "true" MultiValued = "true"
TypeMajorVersion = "1"> </Field>
<Field Name = "PersonalPicture" Type = "Base. Link" Nullable = "true"
TypeMajorVersion = "1"> </Field>
...
</Type>
During programming, you only need to load System. Storage to program WinFS. For example, the Contact. ListContacts () method is to list all contacts in storage. The code for creating a Contact is as follows:
// This actually create the person object.
Person person = Person. CreatePersonalContact (context );
Person. DisplayName = name;
// This populates the person object with some valuable data
// Such as an e-mail address and a phone number
SmtpEmailAddress email = new SmtpEmailAddress ("shanede@microsoft.com ");
CategoryRef primaryEmailCategory = new CategoryRef (GeneralCategories. Primary );
Email. Categories. Add (primaryEmailCategory );
Person. PersonalEmailAddresses. Add (email );
TelephoneNumber phone = new TelephoneNumber ();
Phone. AreaCode = "425 ";
Phone. Number = "555-1234 ";
Person. PersonalTelephoneNumbers. Add (phone );
// This actually updates "WinFS" with the new data.
Context. Update ();
Unfortunately, the items in this directory are 0 bytes without an extension. I don't know what it is, unlike the Schema file. The contact. xml file cannot be searched. I found some WinFS-related programs, including pure C #, aveon, and MSBuilding. The program is compiled successfully, but an error occurs. Even simple programs such as creating new items and changing Item properties cannot run successfully. It seems that there are many restrictions on WinFS in Longhorn in this version.
After two days of WinFS, I was planning to learn more about Longhorg, such as Indigo, aveon programming and speech recognition. Even WinFS has a lot of content to explore, such as its Storage Engine, Security, and Synchronization. However, it is found that there are too many restrictions on Longhorn in the current version, many features of the released materials are not supported yet, And there will certainly be many variables in the future, so I decided to put this novelty aside for the moment and stay tuned to its changes. In fact, Longhorn is far away from us, and the current hardware level is hard to meet its needs for the time being. Therefore, for ordinary people, we can understand their overview and development trends, but it is not necessary to study them in depth.