Re: Model_Task function names

Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> Sat, 4 May 2013 00:01:56 +0200
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CA+z51A4nuZKTYfE8MpZ0NB=dQewKHW=YJyGLDRdxZq-a34aWhA@mail.gmail.com>
--===============2942168209460356878==
Content-Type: multipart/alternative; boundary=089e0158c3e00e2ef304dbd78100

--089e0158c3e00e2ef304dbd78100
Content-Type: text/plain; charset=UTF-8

Nice - that was quick!


On 3 May 2013 22:37, Bharat Mediratta <[email protected]> wrote:

>
> Well, can't use my API because get() takes a default value and returns it
> if the key doesn't exist.  And we use that widely.  So I went with your
> get_data() / set_data() API instead.  Pushed!
>
>
> On Fri, May 3, 2013 at 1:17 PM, Bharat Mediratta <[email protected]>wrote:
>
>>
>> I'll take it.
>>
>>
>> On Fri, May 3, 2013 at 1:15 PM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:
>>
>>> I like it.  Wanna dive in or should I?
>>>
>>>
>>> On 3 May 2013 22:11, Bharat Mediratta <[email protected]> wrote:
>>>
>>>>
>>>> Hm.  We could use the K3 model and just have:
>>>>
>>>>   data($key, $value=null)
>>>>
>>>> So for examples:
>>>>
>>>>   $task->data("foo", "bar");  // set the value of "foo" to "bar"
>>>>   $task->data("foo");  // return the value of "foo"
>>>>
>>>> how does that sound?
>>>>
>>>>
>>>> On Fri, May 3, 2013 at 1:05 PM, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:
>>>>
>>>>> Hey everyone,
>>>>>
>>>>> While working on the photo/movie/album add/edit forms, I wanted to get
>>>>> server_add working so I can add and test things, and found a problem:
>>>>>
>>>>> We used get() and set() in the task model to get/set things in the
>>>>> task's content column.  This totally clobbers the K3 ORM, which has a get()
>>>>> and set() of its own.  Bummer.
>>>>>
>>>>> I briefly looked into overloading the ORM get() and set(), but I don't
>>>>> think it's a great idea.  If someone ever wants to get/set something that
>>>>> has the name of a task column (e.g. "id"), it's hard to tell what to do.
>>>>>
>>>>> So, it looks like we'll have to rename them.  Perhaps something like:
>>>>> get_task(), set_task()
>>>>> get_context(), set_context()
>>>>> read(), write()
>>>>> get_data(), set_data()
>>>>> ...?
>>>>>
>>>>> Thoughts?
>>>>>
>>>>> Take care,
>>>>> Shad
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Get 100% visibility into Java/.NET code with AppDynamics Lite
>>>>> It's a free troubleshooting tool designed for production
>>>>> Get down to code-level detail for bottlenecks, with <2% overhead.
>>>>> Download for free and get started troubleshooting in minutes.
>>>>> http://p.sf.net/sfu/appdyn_d2d_ap2
>>>>> __[ g a l l e r y - d e v e l ]_________________________
>>>>>
>>>>> [ list info/archive --> http://gallery.sf.net/lists.php ]
>>>>> [ gallery info/FAQ/download --> http://gallery.sf.net ]
>>>>>
>>>>
>>>>
>>>
>>
>

--089e0158c3e00e2ef304dbd78100
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Nice - that was quick!</div><div class=3D"gmail_extra"><br=
><br><div class=3D"gmail_quote">On 3 May 2013 22:37, Bharat Mediratta <span=
 dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">bh=
[email protected]</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>Well, can&#39;t us=
e my API because get() takes a default value and returns it if the key does=
n&#39;t exist. =C2=A0And we use that widely. =C2=A0So I went with your get_=
data() / set_data() API instead. =C2=A0Pushed!</div>



</div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Fri,=
 May 3, 2013 at 1:17 PM, Bharat Mediratta <span dir=3D"ltr">&lt;<a href=3D"=
mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</sp=
an> wrote:<br>



<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>I&#39;ll take it.<=
/div></div><div><div><div class=3D"gmail_extra"><br>
<br>
<div class=3D"gmail_quote">On Fri, May 3, 2013 at 1:15 PM, Shad Laws <span =
dir=3D"ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad=
@shadlaws.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">I like it. =C2=A0Wanna dive=
 in or should I?</div><div><div><div class=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On 3 May 2013 22:11, Bharat Mediratta <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank"=
>[email protected]</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><div>Hm. =C2=A0We could=
 use the K3 model and just have:</div><div><br></div><div>=C2=A0 data($key,=
 $value=3Dnull)</div>






<div><br></div><div>So for examples:</div><div><br></div><div>

=C2=A0 $task-&gt;data(&quot;foo&quot;, &quot;bar&quot;); =C2=A0// set the v=
alue of &quot;foo&quot; to &quot;bar&quot;</div><div>=C2=A0 $task-&gt;data(=
&quot;foo&quot;); =C2=A0// return the value of &quot;foo&quot;</div><div><b=
r></div>

<div>how does that sound?</div></div><div class=3D"gmail_extra"><br><br><di=
v class=3D"gmail_quote">On Fri, May 3, 2013 at 1:05 PM, Shad Laws <span dir=
=3D"ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad@sh=
adlaws.com</a>&gt;</span> wrote:<br>








<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Hey everyone,<div><br></div=
><div>While working on the photo/movie/album add/edit forms, I wanted to ge=
t server_add working so I can add and test things, and found a problem:</di=
v>








<div><br></div><div>

We used get() and set() in the task model to get/set things in the task&#39=
;s content column. =C2=A0This totally clobbers the K3 ORM, which has a get(=
) and set() of its own. =C2=A0Bummer.</div><div><br></div><div>I briefly lo=
oked into overloading the ORM get() and set(), but I don&#39;t think it&#39=
;s a great idea. =C2=A0If someone ever wants to get/set something that has =
the name of a task column (e.g. &quot;id&quot;), it&#39;s hard to tell what=
 to do.</div>










<div><br></div><div>So, it looks like we&#39;ll have to rename them. =C2=A0=
Perhaps something like:</div><div>get_task(), set_task()</div><div>get_cont=
ext(), set_context()</div><div>read(), write()</div>

<div>get_data(), set_data()</div><div>...?</div><div><br></div><div>Thought=
s?</div><div><br></div><div>Take care,</div><div>Shad</div></div>
<br>-----------------------------------------------------------------------=
-------<br>
Get 100% visibility into Java/.NET code with AppDynamics Lite<br>
It&#39;s a free troubleshooting tool designed for production<br>
Get down to code-level detail for bottlenecks, with &lt;2% overhead.<br>
Download for free and get started troubleshooting in minutes.<br>
<a href=3D"http://p.sf.net/sfu/appdyn_d2d_ap2" target=3D"_blank">http://p.s=
f.net/sfu/appdyn_d2d_ap2</a><br>__[ g a l l e r y - d e v e l ]____________=
_____________<br>
<br>
[ list info/archive --&gt; <a href=3D"http://gallery.sf.net/lists.php" targ=
et=3D"_blank">http://gallery.sf.net/lists.php</a> ]<br>
[ gallery info/FAQ/download --&gt; <a href=3D"http://gallery.sf.net" target=
=3D"_blank">http://gallery.sf.net</a> ]<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</blockquote></div><br></div>

--089e0158c3e00e2ef304dbd78100--


--===============2942168209460356878==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
--===============2942168209460356878==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__[ g a l l e r y - d e v e l ]_________________________

[ list info/archive --> http://gallery.sf.net/lists.php ]
[ gallery info/FAQ/download --> http://gallery.sf.net ]
--===============2942168209460356878==--