<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Chris,<div><br></div><div>You don’t just use Magma, you *are* Magma! Thank you for the thoughtful reply. That does look like a great feature of Magma but it leads me to four questions:</div><div><br></div><div>1) Old vs. New?</div><div>As you instruct MagmaDataRepair to enumerate and “hydrate” your objects from the DB, how do you look at the “old way” and the “new way” at the same time so you can do the #improve message? In my example the old way had a Person -&gt; Profession (a to-one relationship, a single object). In the new way Person -&gt;&gt; Profession (a to-many relationship, an array, or B-Tree, etc). The class in Smalltalk is already “new” so how can it deal with the “old” form of what was stored in the DB?</div><div><br></div><div>2) Lazy Improve</div><div>What if the object itself, “Person” could know how to improve itself? And as you access Persons they automatically improve themselves. Then you wouldn’t need to modify all the objects at once and they could self-heal as needed. It would need a way to look at its old self and “self improve.” Is this a bad idea? Anyone done this?</div><div><br></div><div>3) Auto repair / improve</div><div>It looks like MagmaDataRepair is something I would run from a workspace. Suppose I was working on this app with Dirk and Dave. Do I really have to tell them both “Hey guys, I’m going to Skype you some text to run in our workspace to update our data model but before you do, pull from the repo.” That seems like a lot to remember and go wrong. Isn’t there a way after the pull from the repo and accessing your app that it will “self improve” so I don’t actually have to tell Dirk and Dave anything and when we deploy we don’t have to remember to do anything either.</div><div><br></div><div>4) Queued repairs / improvements</div><div>Imagine one of my team-mates was on vacation for two weeks. After he comes back he wants to get back into our Smalltalk app. During that time there have been 7 (seven) MagmaDataRepair scripts created by various people (Me and Dirk mostly). Isn’t there a way to have them all put together in chronological order so when Dave returns from his cruise he can just “run” and all 7 MagmaDataRepairs will be applied without him thinking about it?</div><div><br></div><div>Thanks,<br><div apple-content-edited="true">
<table style="margin-top: 0.5em; margin-left: 0.5em; margin-bottom: 30px; position: static; z-index: auto;" border="0">
        <tbody><tr>
                <td colspan="2" style="padding-bottom: 0.3em; ">
                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#888888;line-height:22px"><b style="color:#11aeab;text-transform:uppercase;letter-spacing:2px">Aaron Rosenzweig</b>&nbsp;/&nbsp;<a href="http://www.chatnbike.com" title="visit Chat 'n Bike" style="text-decoration:none; border-bottom:1px dotted #888888;color:#888888">Chat 'n Bike</a></span><br>
                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#b2b2b2;"><b style="color:#888888">e:</b>&nbsp;&nbsp;<a href="mailto:aaron@chatnbike.com" title="email Aaron" style="text-decoration:none; border-bottom:1px dotted #b2b2b2;color:#b2b2b2">aaron@chatnbike.com</a>&nbsp;&nbsp;<b style="color:#888888">t:</b>&nbsp;&nbsp;(301) 956-2319</span>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/chat_n_bike_logo_small.png" alt="Chat 'n Bike" height="100">
                </td>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/dealers/usa.jpg" alt="Chat 'n Bike" height="100">
                </td>
        </tr>
</tbody></table>

</div>
<br><div><div>On Apr 26, 2014, at 5:13 PM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><div>I use Magma, but yes, Data-quality management applies to any persistent model, and is a little more involved than at first it seems, because it's tempting to just spank-out a workspace script which enumerates appropriate objects in your DB and fixes/upgrades them.</div>
<div><br></div><div>But doing only that is loaded with caveats. &nbsp;After running a repair script, can one _really_ feel comfortable the model is "all fixed" and ready for production? &nbsp;Did the script really work? &nbsp;Did it catch all cases or was there possibly a bug in it?</div>
<div><br></div><div>To address these concerns, Magma employs a first-class DataRepair which is used to perform data repairs/migrations on Magma models in a controlled and reliable fashion. &nbsp;It is based on the repair process we used at Florida Power and Light for patching/upgrading the models in its GemStone databases.</div>
<div><br></div><div>The requirements of a data-repair are:</div><div><br></div><div><span class="" style="white-space:pre">        </span>- Enumerate all objects needing repair.</div><div><span class="" style="white-space:pre">        </span>- Of the enumerated objects, #check, #count or #identify the ones that are in need of repair.</div>
<div><span class="" style="white-space:pre">        </span>- Of the enumerated objects, #improve or #repair the ones that are in need of repair.</div><div><span class="" style="white-space:pre">        </span>- Before committing #repair, _verify_ whether the repaired objects are, in fact, repaired by using the same check as for #check, #count and #identify. &nbsp;If they are, commit, if not, abort.</div>
<div><span style="white-space:pre">        - Connect a brand-new session, run a final #check and report whether the repair was successful or failed.</span><br></div><div><span style="white-space:pre">        - (Optional) If successful, you might wish to persist the DataRepair object itself somewhere in your database, so it has a history of what was done to it.</span><span style="white-space:pre"><br>
</span></div><div><span style="white-space:pre">        - Output</span>&nbsp;report of for each of the above actions.</div><div><br></div><div>Here is an example of Magma's DataRepair constructor:</div><div><br></div><div>(MagmaDataRepair</div>
<div><span class="" style="white-space:pre">        </span>at: (MagmaRemoteLocation host: 'prod1' port: 51199)</div><div><span class="" style="white-space:pre">        </span>enumerate: [ : session : repair | session root accountsDo: [ : eachAccount | repair check: eachAccount ] ]</div>
<div><span class="" style="white-space:pre">        </span>check: [ : eachAccount : repair | eachAccount importFilters anySatisfy: [ : each | each class = MaxImportFilter ] ])</div><div><span class="" style="white-space:pre">        </span>repair: [ : eachAccount : repair | eachAccount importFilters withIndexDo: [ : eachFilter : index | eachAccount importFilters at: index put: eachFilter asKeywordFilter ] ]</div>
<div><br></div><div>To this object, I can send any of the 5 actions: &nbsp;#check, #count, #identify, #improve or #repair. &nbsp;The first three are read-only operations. &nbsp;The 4th will commit the repairs as-it-goes, the last one only commits after a successful pre-verification.</div>
<div><br></div><div>Although you the user must specify the enumerate:, check: and repair: blocks, the DataRepair object encapsulates the _process_ of repairing models in a controlled and reliable fashion, by using those user-specified, model-specific blocks.</div>
<div><br></div><div>&nbsp;- Chris</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 26, 2014 at 11:55 AM, Aaron Rosenzweig <span dir="ltr">&lt;<a href="mailto:aaron@chatnbike.com" target="_blank">aaron@chatnbike.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi,<div><br></div><div>We’ve been experimenting with GOODS as an object database persistency mechanism for a couple of weeks. We plan to use Dali with it too. We’re really excited about this but have a burning question.</div>
<div><br></div><div><b>Question:&nbsp;</b></div><div>How do we handle changes to the “model” layer?&nbsp;</div><div><br></div><div><b>Example:&nbsp;</b></div><div>Suppose that last week we had a “Person” and “Profession” object. Each “Person” could only have one “Profession.” We’ve been saving some data to our Object Database and have 500 people and 25 professions currently saved and used with our app.</div>
<div><br></div><div>This week we realize that our world view is wrong. Some people are both a “Chef” and a “Computer Scientist.” They have 2 or more professions. We must change our “model.” The class “Person” must change.&nbsp;</div>
<div><br></div><div>How do we fix our object database now?</div><div><br></div><div><b>Background:</b></div><div>This isn’t really a GOODS specific question is it? I imagine it is the same issue with Magma, GemStone, etc. But in all the examples I’ve found nobody seems to talk about “migrations” or maybe I’ve overlooked it. Can someone point me in the right direction?</div>
<div><br></div><div>In NeXT / Apple WebObjects I would write a “migration” to do the necessary steps to change SQL tables, make new DB constraints, etc. as an executable script. I would commit this migration to the repository. Any of the other developers on our team would automatically get it when they pulled from the repository. They don’t need to think about it. As soon as the WebObjects app launches the migrations would be run and they could see the new functionality and make “Marcus” both a “Chef and a Computer Scientist." When we deploy the new code in production, the migration will automatically run there too. This is all explained in detail here:</div>
<div><br></div><div><a href="https://github.com/wocommunity/wonder/blob/master/Frameworks/Core/ERExtensions/Sources/er/extensions/migration/package.html" target="_blank">https://github.com/wocommunity/wonder/blob/master/Frameworks/Core/ERExtensions/Sources/er/extensions/migration/package.html</a></div>
<div><br></div><div>Any helpful pointers are appreciated.</div><div><br></div><div>Thank you,</div><div><div>
<table style="margin-top:0.5em;margin-left:0.5em;margin-bottom:30px" border="0">
        <tbody><tr>
                <td colspan="2" style="padding-bottom:0.3em">
                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#888888;line-height:22px"><b style="color:#11aeab;text-transform:uppercase;letter-spacing:2px">Aaron Rosenzweig</b>&nbsp;/&nbsp;<a href="http://www.chatnbike.com/" title="visit Chat 'n Bike" style="text-decoration:none;border-bottom:1px dotted #888888;color:#888888" target="_blank">Chat 'n Bike</a></span><br>

                        <span style="font-family:'Trebuchet MS',helvetica,San-Serif;font-size:11px;color:#b2b2b2"><b style="color:#888888">e:</b>&nbsp;&nbsp;<a href="mailto:aaron@chatnbike.com" title="email Aaron" style="text-decoration:none;border-bottom:1px dotted #b2b2b2;color:#b2b2b2" target="_blank">aaron@chatnbike.com</a>&nbsp;&nbsp;<b style="color:#888888">t:</b>&nbsp;&nbsp;<a href="tel:%28301%29%20956-2319" value="+13019562319" target="_blank">(301) 956-2319</a></span>
                </td>
        </tr>
        <tr>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/chat_n_bike_logo_small.png" alt="Chat 'n Bike" height="100">
                </td>
                <td>
                        <img src="http://www.chatnbike.com/WebObjects/FamilyCycleGroupOrder.woa/Contents/WebServerResources/images/dealers/usa.jpg" alt="Chat 'n Bike" height="100">
                </td>
        </tr>
</tbody></table>

</div>
<br></div></div><br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>Magma mailing list<br><a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/mailman/listinfo/magma<br></blockquote></div><br></div></body></html>