Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

INFO: Efficient implement of the Serialize and DeserializeChild methods

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensionsMFC
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Fri Aug 29, 2008 4:26 am    Post subject: INFO: Efficient implement of the Serialize and DeserializeChild methods

The DeserializeChild function of CNSEFolder class is called multiple times for each item in the namespace extension as Windows Explorer (or another browser program) tries to retrieve information associated with the item such as its displayname, icon, infotip, etc. The Serialize function is called once for each item. For this reason, the implementation of the DeserializeChild and Serialize functions should be as efficient as possible. Unnecessary operations such as web access, database queries, file-system access and other such potentially time-consuming operations should be avoided.

Furthermore, the Serialize function should store only that data which is necessary to completely identify the item. Other data associated with the item can loaded afterwards as and when necessary.

For example:

RegsitryBrowser sample:
CValueItem class : only value name and full path of parent key is serialized - this is all that is required to identify the item. The 'value data' associate with the CValueItem is not serialized since it can be loaded only when required from the registry.

FileSystemBrowser sample:
CFolderitem/CFileItem class : only fullpath is serialized - this is all that is required to identify the file/folder. Other information such as file size, date modified, file type etc is not serialized since it is not required and can be loaded only when required from the file-system.
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensionsMFC All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group