Title: WinFS
1WinFS Future Technologies
- Damir Dobric
- DAENET
- http//developers.de/blogs/damir_dobric/default.as
px
2Sponzori
3(No Transcript)
4Sadržaj predavanja
- WInFS history and Motivation
- WinFS Data model
- WinFS Type System
- Item Lifetime
- Item Extensions
- Item Relations
- Future of WinFS
- QA
5History of WinFS
- Started in the early 1990s.
- Dubbed Object File System (OFS)
- it was supposed to be included as part of Cairo.
- Later during the development of COM, a storage
system - Called Storage,
- Based on then-upcoming SQL Server 8.0,
- Relational File System, was conceived to be
launched with SQL Server 2000, but as SQL Server
2000 ended up being a minor upgrade to SQL Server
7.0, RFS - On August 29, 2005, Microsoft quietly made Beta 1
- Available to MSDN subscribers.
- It worked on Windows XP
- It was refreshed on December 1, 2005 to be
compatible with version 2.0 of the .NET
Framework.
6WinFS Motivation
- Unify
- Structured DB
- Semi-structured - XML
- Unstructured Flat file
- Organize
- Think beyond the rigid hierarchy of the
traditional folder model - Explore
- Efficient exploration of information, powerful
queries - Innovate.
- New data platform for application developers
7What is WinFS?
- Active Storage Platform
- Active storage platform for organizing,
searching, and sharing all kinds of information - Rich data model on the top of a relational
storage engine - Flexible programming model WinFS API
- File System
- For file-based data (text documents, audio
tracks, video clips ..) - Efficient indexing and streaming capabilities
8Some key points
- Traditional DB -gt Relational data
- Traditional Fileystems Three
- WinFS -gt Directed Acyclic Graph (DAG)
- WinFS -gt HighLevel database
9WinFS - Data Model
- Schemas
- Types
- Items
- Attributes
- Fragments
- Extensions
- Associations
Item
Attr1
Attr2
Attr N
relationship
Item
Item
Attr1
Attr2
Attr N
Attr1
Attr2
Attr N
10Organization of the data
- By types and attributes
- Predefined Types (Person, Contact, Document,..)
- Custom Types (Type Definition Language)
- By Relationship (Item Associations)
- Containment Relationships
- Links
- Sharing of common values
- By grouping in categories
11Type Definition Language
lt?xml version"1.0"?gt ltSchema Version"0.2.0"
Alias"Contacts" Namespace "System.Storage.Con
tactsxmlns"http//schemas.micr osoft.com/winfs/2
003/09/schema" gt ltUsing Version"0.1"
Alias"WinFS" Namespace"System.Storage" /gt
ltUsing Version"0.1" Alias"Core"
Namespace"System.Storage.Core" /gt ltEntityType
Name"Contact" BaseType"WinFS.Item" gt ltProperty
Name"EAddresses" Type"Array(Core.EAddress)"
Nullable"true" ChangeUnit"EAddressesCu"gt
lt/Propertygt ...
12Types in WinFS
- Scalar Types
- Enumeration Types
- Inline Types
- I.e. FullName
- Entity Types
- Item
- Link
- ItemFragment
- Set of other types
- Extensions
13Type System - Examples
WinFS CLR type
String String
Binary Byte
Boolean Boolean
Byte Byte
Int16 Int16
Int32 Int32
Int64 Int64
Single Single
Double Double
Decimal Decimal
DateTime DateTime
Guid Guid
14WinFS Item
- Item is the smallest unit of data
- Imagine Item as a vector
- Item is strongly typed
- Item is a root in the hierarchy
- Item is abstract class
- public abstract class Item Entity
15Currently defined items
Class Description
Audio.RadioStation Represents a radio station that may provide streams of radio.
RadioStreams Represents a radio stream that a radio station provides.
Schedule A collection of events, appointments, or meetings associated with a user.
ScheduleEntry An item that records the occurrence of something in the environment.
Contact Represents either an organization or a person
OpaqueItem Represents the opaque binary data.
Document An item that represents content that is authored
Folder A Folder item is a container of items..
GenericFile Represents a generic file item.
Document Represents audio documents, such as tracks and albums.
Message Represents any message in the system.
Rule An abstract base class for all "WinFS" rule objects.
Share Represents information about a "WinFS" share.
StoreInfo Represents information about a "WinFS" store.
Sync.Conflict Provides custom methods for the conflict object
NonSynchronizedItem All item types deriving from this type and all entities located below this item
Video.VideoClip Represents a video clip.
16Life time of an Item
public static void CreateItem()
using (WinFSData store new WinFSData())
Document doc1 new
Document() doc1.DisplayName
"docX" Document doc2 new
Document() doc2.DisplayName
"docX" Folder root
store.GetRootItem() as Folder
root.Children.Add(doc1)
root.Children.Add(doc2)
store.SaveChanges()
17DEMO Item Lifetime
18Item Extensions
public void AppendKeyword(string keyWord)
Folder folder store.Items.FilterByTypeltFol
dergt(). Filter("DisplayName
'ExtensionHandling'"). GetFirst()
Document doc new Document(folder)
doc.NamespaceName "KeyWordTest.doc"
doc.DisplayName "KeyWordTest"
doc.Title "Daenet Keyword Test"
Keyword keyW new Keyword(keyWord)
ItemKeywords kwds new
ItemKeywords() kwds.Keywords.Add(keyW
) doc.Extensions.Add(kwds)
store.SaveChanges()
string filterExpression "Exists(Extensions.Filt
erByType(_at_0).Filter(Exists(Keywords.Filter(Value
_at_1))))"
19DEMO Item Extensions
20Item Relations
- Links
- Relation between Entities
- Defined by Source and Target
- Link is physical construct in store
- Associations
- Entity based (Links)
- None Entity based
- Association is not a physical construct in store
- API generator creates Helper class
21Links
Item 1
Attr1
Attr2
Attr N
Link
Item 2
Attr1
Attr2
Attr N
- System.Object System.Storage.StoreObject
System.Storage.Entity System.Storage.
Link System.Storage.Calendar.ScheduledEnt
ryLink System.Storage.FolderToStoreInfoL
ink System.Storage.Messages.AttachmentLi
nk System.Storage.Video.Clips
22Linking of items
public void CreateDocumentsAndRelations()
// Create documents and one
message. Document document1 new
Document(folder) Message message
new Message(folder)
document1.DisplayName "Document1"
document1.NamespaceName "Document1"
message.DisplayName "Message1"
message.NamespaceName "Message1"
// Create the link.
AttachmentLink link1 new AttachmentLink(messag
e, document1) store.SaveChanges()
23Searching for Links
StorageSearcherltAttachmentLinkgt linkSearcher
store.Links .FilterByTypeltAttachme
ntLinkgt() .Filter("Exists(Target.N
amespaceName like '_at_0')", "Document)")
foreach (AttachmentLink l in linkSearcher)
if (l.Source ! null
l.Target ! null)
Console.WriteLine(l.Target.NamespaceName
" - " l.Source.NamespaceName)
24DEMO Linking of items
25Entity Based Associations
GetLinksGivenSource Finds all links associated with a single source item. This method is not CLS-compliant.
GetLinksGivenSources Finds all links associated with a collection of sources. This method is not CLS-compliant.
GetLinksGivenTarget Finds all links associated with a single target. This method is not CLS-compliant.
GetLinksGivenTargets Finds all links associated with a collection of targets. This method is not CLS-compliant.
GetSourcesGivenLinks Finds all sources associated with a collection of links. This method is not CLS-compliant.
GetSourcesGivenTarget Finds all sources associated with a single target. This method is not CLS-compliant.
GetSourcesGivenTargets Finds all sources associated with a collection of targets. This method is not CLS-compliant.
GetTargetsGivenLinks Finds all targets associated with a collection of links. This method is not CLS-compliant.
GetTargetsGivenSource Finds all targets associated with a single source. This method is not CLS-compliant.
GetTargetsGivenSources Finds all targets associated with a collection of sources. This method is not CLS-compliant.
- API Generator
- Three entities Link, Source and Target
- LinkRelation Helper Class
26 None Entity Based Associations
UserTask PrimaryTask new UserTask() PrimaryTask
.DisplayName "Birthday UserTask"
PrimaryTask.NamespaceName "Birthday UserTask"
PrimaryTask.CorrelationId new
CorrelationId("PrimaryTaskId")
exampleFolder.Children.Add(PrimaryTask) UserTask
SubTask1 new UserTask() SubTask1.DisplayName
"Arrange Hall" SubTask1.NamespaceName
"Arrange Hall" SubTask1.TaskParentTask new
CorrelationId("PrimaryTaskId")
exampleFolder.Children.Add(SubTask1)
StorageSearcherltUserTaskgt ParentTaskSearcher
TaskParentTasks.GetParentTasksGivenTask(t)
27WinFS Services
- RsFxSvc.Exe, RsFxDrv.Sys
- C\RsFxName\MachineName\DefaultStore
- Coordinate file services
- E.g. gtpushd
- WinFS.exe
- C\System Volume Information\WinFS\15836D96-5B44-
4DB9-AD69-3C76B99C8571\ - \Database.mdf
- \Database.ldf
- WinFS Search service
- WinFS File Promotion manager
- WinFS Sync
- WinFS Rule Engine
28WinFS Architecture
29WinFS vs. NTFS?
- Relational Storage Engine
- Expanded to stores streams
- Called File Backed Items
- WinFS works with Item only
- Win32 API works with streams only
- MetadataServices keeps consistency (stream lt-gt
item) - Promotion, Demotion
30NTFS File Sparsing
- HANDLE hFile CreateFile("file.datalt", ...
- DeleteFile("file.datalt")
gtecho "alternative stream" gt SparseMainStream.txt
AltStream.Txt gtnotepad SparseMainStream.txtAltS
tream.Txt
31DEMO Copy a File Between NTFS and WinFS
32WinFS Performance
StorageSearcherltStorageRecordgt searcher
wData.Items.FilterByTypeltPersongt() .Filter(
"Container.ItemId _at_0", exampleFolder.ItemId) .Pr
oject("it as Person, ContactCards as
ContactCards") foreach (StorageRecord record in
searcher) Person person
(Person)record"Person" IListltContactCardgt
contactCards (IListltContactCardgt)record"Con
tactCards" foreach (ContactCard card in
contactCards) Console.WriteLine(" "
card.Label)
foreach (Person person in peopleSearcher) //
Avoid such queries ! foreach (ContactCard card
in person.ContactCards)
Console.WriteLine(" " card.Label)
33Future of WinFS
- WinFS Beta 2 is planned for May 1, 2006.
- It will include integration with Windows Desktop
Search, - It will also include integration with ADO.NET
API. - A third Beta is scheduled for November 2006.
- The final release is not likely to be available
until late 2007. It is not clear at this time
whether the final release of WinFS will be
included with Windows Server "Longhorn" or not.
34- www.daenet.de
- www.daenet.ba
- Damir Dobric Blog http//developers.de/blogs/dami
r_dobric/default.aspx - DAENET team blog http//Developers.de
- Job at DAENET http//homepage.daenet.de/portal/te
mplates/jobmail.htm
Damir Dobric DAENET GmbH www.daenet.de mailtoddob
ric_at_daenet.de