Re: Modularity - Users and UserProfile controllers

Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> Sat, 11 May 2013 19:33:19 +0200
Newsgroups gmane.comp.web.gallery.devel
Message-ID <CA+z51A6iLRXwRC_a4JLsv3bWZLXZDNT3yGrf2EYLwka-Cez6-Q@mail.gmail.com>
--===============2856108497559490337==
Content-Type: multipart/alternative; boundary=001a11c33ffc2779ec04dc74afff

--001a11c33ffc2779ec04dc74afff
Content-Type: text/plain; charset=UTF-8

While we're at it, perhaps we should fold the Controller_Password functions
in here, too...


On 11 May 2013 19:31, Shad Laws <shad-xpYdmXCiSuZWk0Htik3J/[email protected]> wrote:

> Hey everyone,
>
> I just finished converting the user/group-related controllers and forms
> over to Formo, and found that the view used in
> Controller_UserProfile::action_show() (gallery module) has URLs to things
> in Controller_Users (user module)... which seems like a breach of
> modularity.
>
> Right now, we have:
> [user module]
> class Controller_Users extends User_Controller_Users {}
> class User_Controller_Users {
>   public function action_edit();
>   public function action_change_email();
>   public function action_change_password();
> }
> [gallery module]
> class Controller_UserProfile extends Gallery_Controller_UserProfile {}
> class Gallery_Controller_UserProfile {
>   public function action_show();
>   public function action_contact();
> }
>
> My thought:
> - in the gallery module, change Controller_UserProfile to make it an
> abstract class in IdentityProvider.
> - add three abstract action functions that reflect the three links it
> wants.
> - in the user module, make Controller_UserProfile extend the abstract
> class in Gallery.
>
> Then, we'd have something like:
> [user module]
> class Controller_Users extends User_Controller_Users {}
> class User_Controller_Users extends IdentityProvider_Controller_Users {
>   public function action_edit();
>   public function action_change_email();
>   public function action_change_password();
> }
> [gallery module]
> abstract class IdentityProvider_Controller_Users extends
> Gallery_IdentityProvider_Controller_Users {}
> abstract class Gallery_IdentityProvider_Controller_Users {
>   public function action_show();
>   public function action_contact();
>   abstract public function action_edit();
>   abstract public function action_change_email();
>   abstract public function action_change_password();
> }
>
> Thoughts?
>
> Take care,
> Shad
>

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

<div dir=3D"ltr">While we&#39;re at it, perhaps we should fold the Controll=
er_Password functions in here, too...</div><div class=3D"gmail_extra"><br><=
br><div class=3D"gmail_quote">On 11 May 2013 19:31, Shad Laws <span dir=3D"=
ltr">&lt;<a href=3D"mailto:shad-xpYdmXCiSuZWk0Htik3J/[email protected]" target=3D"_blank">shad@shadla=
ws.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>I just finished converting the user/group-related controllers and for=
ms over to Formo, and found that the view used in Controller_UserProfile::a=
ction_show() (gallery module) has URLs to things in Controller_Users (user =
module)... which seems like a breach of modularity.</div>


<div><br></div><div>Right now, we have:</div><div><font face=3D"courier new=
, monospace">[user module]<br></font></div><div><font face=3D"courier new, =
monospace">class Controller_Users extends User_Controller_Users {}</font></=
div>


<div><font face=3D"courier new, monospace">class User_Controller_Users {<br=
></font></div><div><div><font face=3D"courier new, monospace">=C2=A0 public=
 function action_edit();</font></div><div><font face=3D"courier new, monosp=
ace">=C2=A0 public function action_change_email();</font></div>


<div><font face=3D"courier new, monospace">=C2=A0 public function action_ch=
ange_password();</font></div><div><font face=3D"courier new, monospace">}</=
font></div></div><div><font face=3D"courier new, monospace">[gallery module=
]</font></div>


<div><font face=3D"courier new, monospace">class Controller_UserProfile ext=
ends=C2=A0Gallery_Controller_UserProfile=C2=A0{}</font></div><div><font fac=
e=3D"courier new, monospace">class Gallery_Controller_UserProfile {<br></fo=
nt></div>


<div><font face=3D"courier new, monospace">=C2=A0 public function action_sh=
ow();</font></div><div><font face=3D"courier new, monospace">=C2=A0 public =
function action_contact();</font></div><div><font face=3D"courier new, mono=
space">}</font></div>


<div><br></div><div>My thought:<br></div><div>- in the gallery module, chan=
ge Controller_UserProfile to make it an abstract class in IdentityProvider.=
</div><div>- add three abstract action functions that reflect the three lin=
ks it wants.</div>


<div>- in the user module, make Controller_UserProfile extend the abstract =
class in Gallery.</div><div><br></div><div>Then, we&#39;d have something li=
ke:</div><div><div><div><font face=3D"courier new, monospace">[user module]=
<br>


</font></div><div><font face=3D"courier new, monospace">class Controller_Us=
ers extends User_Controller_Users {}</font></div><div><font face=3D"courier=
 new, monospace">class User_Controller_Users extends IdentityProvider_Contr=
oller_Users {</font></div>


<div><div><font face=3D"courier new, monospace">=C2=A0 public function acti=
on_edit();</font></div><div><font face=3D"courier new, monospace">=C2=A0 pu=
blic function action_change_email();</font></div><div><font face=3D"courier=
 new, monospace">=C2=A0 public function action_change_password();</font></d=
iv>


<div><font face=3D"courier new, monospace">}</font></div></div></div><div><=
font face=3D"courier new, monospace">[gallery module]</font></div><div><fon=
t face=3D"courier new, monospace">abstract class IdentityProvider_Controlle=
r_Users extends Gallery_IdentityProvider_Controller_Users {}</font></div>


<div><font face=3D"courier new, monospace">abstract class Gallery_IdentityP=
rovider_Controller_Users=C2=A0{<br></font></div><div><font face=3D"courier =
new, monospace">=C2=A0 public function action_show();</font></div><div><fon=
t face=3D"courier new, monospace">=C2=A0 public function action_contact();<=
/font></div>


<div><font face=3D"courier new, monospace">=C2=A0 abstract public function =
action_edit();</font></div><div><font face=3D"courier new, monospace">=C2=
=A0=C2=A0abstract=C2=A0public function action_change_email();</font></div><=
div><font face=3D"courier new, monospace">=C2=A0=C2=A0abstract=C2=A0public =
function action_change_password();</font></div>


<div><font face=3D"courier new, monospace">}</font></div><div><br></div><di=
v>Thoughts?</div><div><br></div><div>Take care,<br></div><div>Shad</div></d=
iv></div>
</blockquote></div><br></div>

--001a11c33ffc2779ec04dc74afff--


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

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
--===============2856108497559490337==
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 ]
--===============2856108497559490337==--