<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EstiloCorreo17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
php-bounces@listas.inf.utfsm.cl [mailto:php-bounces@listas.inf.utfsm.cl] <b>En
nombre de </b>Gonzalo Diaz<br>
<b>Enviado el:</b> Miércoles, 07 de Julio de 2010 18:00<br>
<b>Para:</b> Lista de desarrolladores en PHP<br>
<b>Asunto:</b> Re: Clase php5<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>El 7 de julio de 2010 17:52, Juan Andrés Ramírez A. &lt;<a
href="mailto:jandres@lagos-ing.com">jandres@lagos-ing.com</a>&gt; escribió:<o:p></o:p></p>

<p class=MsoNormal>&gt; -----Mensaje original-----<o:p></o:p></p>

<div>

<p class=MsoNormal>&gt; De: <a href="mailto:php-bounces@listas.inf.utfsm.cl">php-bounces@listas.inf.utfsm.cl</a>
[mailto:<a href="mailto:php-">php-</a><o:p></o:p></p>

</div>

<p class=MsoNormal>&gt; <a href="mailto:bounces@listas.inf.utfsm.cl">bounces@listas.inf.utfsm.cl</a>]
En nombre de Juan Manuel Doren<br>
&gt; Enviado el: Miércoles, 07 de Julio de 2010 17:50<o:p></o:p></p>

<div>

<p class=MsoNormal>&gt; Para: Lista de desarrolladores en PHP<br>
&gt; Asunto: Re: Clase php5<br>
&gt;<br>
&gt; &gt;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>&gt; &gt; &nbsp;Mi duda es,
para mostrar los datos tendría que hacer una Public<br>
&gt; Function<br>
&gt; &gt; por cada variable para mostrar???, o se puede realizar de una forma<br>
&gt; más<br>
&gt; &gt; eficiente??<br>
&gt;<br>
&gt; esa suele ser la mas eficiente<br>
&gt; pero si defines las propiedades como publicas las puedes usar directo<br>
&gt; desde fuera<br>
&gt;<br>
&gt; $ob = new MiClase();<br>
&gt; $ob-&gt;Ingreso_datos('pepe');<br>
&gt; echo $ob-&gt;nombre;<br>
&gt;<br>
&gt; también pudes usar los metodos magicos __get y __set pero en mi<br>
&gt; opinion es complicarse inutilmente la vida<br>
&gt; y probablemente hacer el programa menos eficiente<o:p></o:p></p>

</div>

<p class=MsoNormal>Vale gracias, y a mí nunca me ha gustado el método get y
set, nunca lo he<br>
usado, ni siquiera en visual que era tan popular.<o:p></o:p></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
&gt;<br>
&gt; <a
href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop"
target="_blank">http://www.php.net/manual/en/language.oop5.overloading.php#language.oop</a><br>
&gt; 5.overloading.members<o:p></o:p></p>

</div>

</div>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<p class=MsoNormal>En el caso de PHP5 y Java se utiliza por el tema de la
visibilidad de atributos. Si trabajarás con todo público (lo cual &quot;no es
lo correcto&quot;) entonces en efecto da lo mismo y no tiene sentido definirle
un método get/set.<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>¿Por qué no es correcto? Porque en la Orientación a Objetos
se puede usar la visibilidad (por ejemplo) considerando que tú código puede ser
reutilizado como librería de otra aplicación, y la &quot;integridad&quot; de un
objeto se ve en peligro con todo público.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal>Por ejemplo, si tus métodos asumen que cierto atributo
contiene un dato con una estructura definida, y desde afuera cambias la
estructura de ese dato, no puedes predecir el comportamiento del objeto.
Asumiendo que un atributo X es un array de largo 3 y tal método siempre lo
itera 3 veces, entonces si lo reemplazas por un array de largo 2, lanzará
errores al usar ese método.<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Por ello los métodos de una
clase se encargan (en teoría) de mantener su integridad :B<span
style='color:#1F497D'><o:p></o:p></span></p>

<div class=MsoNormal align=center style='mso-margin-top-alt:0cm;margin-right:
0cm;margin-bottom:12.0pt;margin-left:5.25pt;text-align:center'><span
style='color:#1F497D'>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal style='margin-bottom:12.0pt'><span style='color:#1F497D'>Tienes
toda la razón y no discuto eso, sólo hice el comentario de que métodos preestablecidos
como get y set nunca los he ocupado, siempre he manejado el acceso a las clases
con propiedades de privado o público, por dar un ejemplo.<o:p></o:p></span></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><br>
-- <br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
Atentamente, Gonzalo Díaz Cruz<br>
Estudiante Ingeniería de Ejecución en Computación e Informática<br>
Universidad de Santiago de Chile<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
<br>
<a href="http://blog.gon.cl/">http://blog.gon.cl/</a><br>
<a href="http://twitter.com/sir_gon">http://twitter.com/sir_gon</a><o:p></o:p></p>

</div>

</div>

</div>

</body>

</html>