{"id":1744,"date":"2024-08-02T11:44:46","date_gmt":"2024-08-02T09:44:46","guid":{"rendered":"https:\/\/blog.sutilweb.eu\/?page_id=1744"},"modified":"2024-08-02T11:44:46","modified_gmt":"2024-08-02T09:44:46","slug":"02-elementos-del-poo","status":"publish","type":"page","link":"https:\/\/sutilweb.eu\/index.php\/lenguajes\/php\/poo-php\/02-elementos-del-poo\/","title":{"rendered":"02. Elementos del POO"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">La&nbsp;<strong>programaci\u00f3n orientada a objetos (POO)<\/strong>&nbsp;es un paradigma que utiliza objetos para interaccionar con el dise\u00f1o de un sistema. Est\u00e1 compuesto de varios elementos o caracter\u00edsticas. La&nbsp;<strong>POO<\/strong>&nbsp;se puede ver como la manera en como nosotros como humanos tratamos de explicar de manera abstracta nuestro mundo real.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Caracter\u00edsticas de la POO<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Como elementos, la POO va a tener b\u00e1sicamente 4:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Clases<\/li>\n\n\n\n<li>Objetos<\/li>\n\n\n\n<li>Atributos<\/li>\n\n\n\n<li>M\u00e9todos<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Clase<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Las&nbsp;<strong>clases<\/strong>&nbsp;son un modelo a seguir que se utiliza para crear&nbsp;<strong>objetos<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Objeto<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Un&nbsp;<strong>objeto<\/strong>&nbsp;es una entidad, la cual tiene 2 facultades muy importantes, tienen caracter\u00edsticas y pueden hacer cosas, es decir, pueden tener <strong>atributos<\/strong> (<strong>caracter\u00edsticas<\/strong>) y <strong>m\u00e9todos<\/strong> (hacer cosas), que los vamos a reconocer porque van acompa\u00f1ados por par\u00e9ntesis. Por lo tanto:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Atributos<\/strong>: son las propiedades que puede tener un objeto<\/li>\n\n\n\n<li><strong>M\u00e9todos<\/strong>: son las acciones que puede realizar un objeto. Los m\u00e9todos estar\u00e1n acompa\u00f1ados por par\u00e9ntesis.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Atributos<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Los&nbsp;<strong>atributos<\/strong>&nbsp;son las&nbsp;<strong>caracter\u00edsticas<\/strong>&nbsp;con las que cuentan nuestros&nbsp;<strong>objetos<\/strong>. Son variables que tienen datos asociados a un objeto.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">M\u00e9todos<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Los&nbsp;<strong>m\u00e9todos<\/strong>&nbsp;son las&nbsp;<strong>acciones<\/strong>&nbsp;que pueden realizar nuestros&nbsp;<strong>objetos<\/strong>. Son los algoritmos asociados a un objeto, que indican la capacidad de lo que \u00e9ste puede hacer. Los&nbsp;<strong>m\u00e9todos<\/strong>&nbsp;son&nbsp;<strong>funciones<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Por tanto, los&nbsp;<strong>m\u00e9todos<\/strong>&nbsp;son&nbsp;<strong>funciones<\/strong>, y los&nbsp;<strong>atributos<\/strong>&nbsp;son&nbsp;<strong>variables<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>La&nbsp;programaci\u00f3n orientada a objetos (POO)&nbsp;es un paradigma que utiliza objetos para interaccionar con el dise\u00f1o de un sistema. Est\u00e1 compuesto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1735,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1744","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Sutil Web","author_link":"https:\/\/sutilweb.eu\/index.php\/author\/sutilweb\/"},"uagb_comment_info":0,"uagb_excerpt":"La&nbsp;programaci\u00f3n orientada a objetos (POO)&nbsp;es un paradigma que utiliza objetos para interaccionar con el dise\u00f1o de un sistema. Est\u00e1 compuesto [&hellip;]","_links":{"self":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1744","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/comments?post=1744"}],"version-history":[{"count":2,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1744\/revisions"}],"predecessor-version":[{"id":1746,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1744\/revisions\/1746"}],"up":[{"embeddable":true,"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/pages\/1735"}],"wp:attachment":[{"href":"https:\/\/sutilweb.eu\/index.php\/wp-json\/wp\/v2\/media?parent=1744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}