Ver Mensaje Individual
  #10 (permalink)  
Antiguo 24/12/2010, 00:03
JaimeSavines
 
Fecha de Ingreso: octubre-2009
Mensajes: 245
Antigüedad: 14 años, 6 meses
Puntos: 17
Respuesta: de donde sacar contenido

Cita:
Iniciado por miktrv Ver Mensaje
jajaja

Veo que el que no sabe eres tu...

precisamente la programación orientada a objetos se basa en un código que se pueda re-usar, y si yo hago una array privado, nadie podrá mantener ese arreglo a no ser que de acceso a la clase...

Un saludo y gracias!
Hmmmm.. Hijo te voy a dar un consejo si bien este es un foro abierto, por lo menos respeta a los que te contestan no hay necesidad de risas, por que en tu caso preguntas algo que es basico en la programacion orientada a objetos y va relacionado con las responsabilidades de tu clase. Hay dos patrones sencillos que te resulven tu duda.

Expert

Who, in the general case is responsible?

Assign a responsibility to the information expert -- the class that has the information necessary to fulfill the responsibility.


Pure Fabrication

Who, when you are desperate, and do not want to violate High Cohesion and Low Coupling?

Assign a highly cohesive set of responsibilities to an artificial class that does not represent anything in the problem domain, in order to support high cohesion, low coupling, and reuse.


Aqui puede leer un poco mas de los Grasp patterns
[URL="http://web.cs.wpi.edu/~gpollice/cs4233-a05/CourseNotes/maps/class4/InformationExpert.html"]http://web.cs.wpi.edu/~gpollice/cs4233-a05/CourseNotes/maps/class4/InformationExpert.html[/URL]
Tambien puedes leer los siguientes libros:
[URL="http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0131489062/ref=sr_1_1?s=books&ie=UTF8&qid=1293170409&sr=1-1"]Applying Uml and patterns[/URL]
[URL="http://www.amazon.com/Object-Design-Roles-Responsibilities-Collaborations/dp/0201379430/ref=sr_1_1?s=books&ie=UTF8&qid=1293170491&sr=1-1"]Object Design: Roles, Responsibilities, and Collaborations
[/URL]

Saludos