TheShift : Using it for custom part definitions

Topics: Writing modules
Nov 1, 2013 at 11:29 AM
Edited Nov 1, 2013 at 11:42 AM
Looking at TheShift concept would it be valid to use it to replace our own custom parts?
An example :
I currently have a custom part that holds an ID property to access an external database record .
With the shift will i be able to hold this ID inside the infoset xml and then retreive/store it later on, getting rid of that extra table used up till now ?
Any pointers on how to do this ?
Do we define custom part properties in migrations ?
Should we use content handlers to get/set these values in our custom part properties?
A small list of steps for developers to use this new concept will be appreciated.
Nov 1, 2013 at 4:52 PM
You can use the Infoset to store the value only if you never query on this value. Then it's just a matter of typing:

public int MyId {
get { return this.Retrieve(x => x.MyId); }
set { this.Store(x => x.MyId, value);

in your part
Nov 1, 2013 at 4:52 PM
this syntax only applies to the next version, as it uses some helpers.
Nov 1, 2013 at 6:59 PM
thanks sebastian,
I really like the simplicity in all of it.
Looking forward to next version to try it out.
Nov 1, 2013 at 8:20 PM
You should still shift your own parts even if you want to query on those properties, but don't remove the record or the record properties: the Store call will still persist to the record, but the XML will be used whenever possible, saving a lot of queries.

I think a blog post is in order about The Shift...
Nov 2, 2013 at 8:32 AM
yes, a blog post would be usefull.
Thank you.
Nov 2, 2013 at 8:57 AM
Edited Nov 2, 2013 at 9:09 AM
+ 1 for Blogpost. When I see the work implied on Orchard, (and Bertrand's Nwazet Commerce), I am a little afraid by the size of adaptation needed and potential side effects. (Halloween here ?)
Nov 2, 2013 at 8:07 PM
What do you mean? It was actually very little work, besides building the libraries, which have now been moved to core.
Nov 2, 2013 at 8:45 PM
Ok, will wait The blogpost because I have questions as how to debug this data? find it in the sql tables with SQL Tools (where ?) ? Changing it on the fly in debug mode when stored in 2 places ? etc.
Nov 4, 2013 at 4:15 PM
Blogged: The Shift: how #OrchardCMS painlessly shifted to document storage, and how it’ll affect you