tag:blogger.com,1999:blog-54992203074315010402024-03-14T01:54:54.299-07:00การเขียนโปรแกรมเชิงวัตถุAnonymoushttp://www.blogger.com/profile/16284879849499817711noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-5499220307431501040.post-6643981924362643262012-12-11T00:49:00.000-08:002012-12-23T04:59:47.333-08:00การเขียนโปรแกรมเชิงวัตถุ<span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"> <span style="color: red;"> </span><span style="color: purple; font-size: x-large;">การเขียนโปรเแกรมเชิงวัตถุ</span></span><br />
<strong><span style="color: purple; font-family: Comic Sans MS; font-size: x-small;"></span></strong><br />
<span style="font-family: inherit;"><span style="color: red; font-size: x-large;"><strong>1.Object- Oriented Programming (OOP)</strong></span></span><br />
<strong><span style="color: red; font-size: x-small;"></span></strong><br />
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"> 1.1Abstraction</span><br />
<h2>
<span style="background-color: transparent; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="color: #0c343d;"><span style="color: black;"><span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">คือ กระบวนการการให้ความคิดรวบยอดกับวัตถุ เพื่อสร้าง class เป็นการแสดงถึงคุณลักษณะและพฤติกรรมของ object เท่าที่จำเป็นต้องรับรู้และใช้งาน โดยซ่อนส่วนที่เหลือเอาไว้เพื่อไม่ให้เกิดความสับสน</span></span></span></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://t3.gstatic.com/images?q=tbn:ANd9GcTh8xGTHcHsVL1JHfxNXo389rGZCJ9nt0mlTq7tiyuk8HroIYBlV6x81s4F" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="281" id="il_fi" src="http://t3.gstatic.com/images?q=tbn:ANd9GcTh8xGTHcHsVL1JHfxNXo389rGZCJ9nt0mlTq7tiyuk8HroIYBlV6x81s4F" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="179" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;">1.2Encapsulation</span></div>
<h2>
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">คือ การรวม data และ method ทั้งหลายที่เกี่ยวข้องกัน และทำงานร่วมกันเอาไว้ใน object หนึ่ง นอกจากนี้แล้วยังมีการซ่อนรายละเอียดของการทำงานของ method ต่างๆใน object เอาไว้ และไม่ให้ object อื่นๆสามารถที่จะเข้าไปแก้ไข data ได้โดยตรง</span></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><img height="240" id="il_fi" src="http://www.k2esec.com/wordpress/wp-content/uploads/2010/07/OSI-Model-Encapsulation1.jpg" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="320" /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;">1.3Modularity</span></div>
<h2>
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.5098066942024777" style="background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">ช่วยให้สามารถทำความเข้าใจระบบที่สลับซับซ้อนได้ ถ้ามีอะไรเสียหาย จะได้แก้ไขเฉพาะส่วนที่เสียหาย</span></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<img height="212" id="il_fi" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIM_9uoBY_BxeipIcp2e5Zo_q0h_lgWxQoarGZzCTlvYyH3J2hevGnSxI_zt0H3s8ZeCMEyJMge_ouLxWTfg2FYfsJu8RjPZD8gbrgrN3Pk6S9I_KKHxgd3dDizPWXK7NrTZE7Fmt11_w/s400/modularity.jpg" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="325" /> </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;">1.4Hierarchy</span></div>
<h2>
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">ลำดับชั้นของการกำหนดกรอบให้แก่วัตถุ สามารถแบ่งออกได้เป็นหลายชนิด</span></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><img height="254" id="il_fi" src="http://image.shutterstock.com/display_pic_with_logo/661747/661747,1288011819,2/stock-photo-a-business-hierarchy-structure-top-to-bottom-63711295.jpg" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="320" /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;">1.5Class</span></span></span></div>
<h2>
<span style="font-size: small;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">คลาส คือ แม่แบบที่ใช้สร้าง Object </span></span></span></span></span></span><span style="font-family: Arial; font-size: small; font-weight: normal;">เช่น คลาสนักเรียน (Student)</span><span style="font-size: small;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><br /></span></span></span></span></span></span><span style="font-size: small;"><br /></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><img height="302" id="il_fi" src="http://www.korean.arts.ubc.ca/c_reso_ex/ex_12/math_class.gif" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="320" /></span></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-size: 32px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;"><span id="internal-source-marker_0.2065817567413719" style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-size: 48px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline;">1.6Object</span></span></span></span></div>
<h2>
<span style="font-size: small;"><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><span id="internal-source-marker_0.14718587022073026" style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">ในการที่เราจะทำความเข้าใจ เกี่ยวกับ Object ให้เรามองทุกๆ อย่างรอบตัวเราเป็น Object เช่น กล้องดิจิตอล</span><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;">Object ประกอบไปด้วย</span></span></span><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: red; font-family: Arial; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;">- Attribute</span><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"> ถ้าเรามอง กล้องดิจิตอลเป็น Object สิ่งที่เป็น attribute ของ Object กล้องดิจิตอล ก็คือ สี , ขนาด และ ยี่ห้อ</span></span></span><span style="background-color: transparent; color: blue; font-family: "Comic Sans MS"; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;"><span style="background-color: transparent; color: red; font-family: Arial; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: initial; vertical-align: baseline;">- Method </span><span style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">แปลเป็นไทยก็ ส่วนของพฤติกรรม <span id="internal-source-marker_0.14718587022073026" style="background-color: transparent; color: black; font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: initial; vertical-align: baseline;">ในการที่เราจะทำความเข้าใจ เกี่ยวกับ Object ให้เรามองทุกๆ อย่างรอบตัวเราเป็น Object เช่น กล้องดิจิตอล จะมี method เป็น ใช้ถ่ายรูปภาพ , ถ่ายวีดิโอ</span></span></span></span></span></h2>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial; font-size: x-large;"><img height="296" id="il_fi" src="http://www.buriramtime.com/_files/webboard/2011_01_09_095507_qcyuibee.jpg" style="padding-bottom: 8px; padding-right: 8px; padding-top: 8px;" width="300" /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: left;">
<h2>
<span style="font-size: small;"><br /> </span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </h2>
<div style="text-align: center;">
<span style="background-color: white; font-family: inherit; font-size: large;"><b></b></span></div>
<div style="text-align: center;">
<span style="font-family: inherit;"><span style="vertical-align: baseline;"><span style="background-color: white;"></span></span></span><br />
<div style="text-align: left;">
<strong><span style="color: #0404e1; font-size: large;"></span></strong><br />
<span style="vertical-align: baseline;"><span style="background-color: white; font-family: inherit;"><b style="background-color: transparent; font-weight: bold;"></b><span style="font-size: large; font-weight: normal;"></span></span></span><br />
<span style="vertical-align: baseline;"><span style="background-color: white; font-family: inherit;"><span style="font-size: large; font-weight: normal;"></span></span></span><br />
<div style="text-align: center;">
<div style="text-align: left;">
<span style="vertical-align: baseline;"><span style="background-color: white; font-family: inherit;"><span style="font-size: large;"></span></span></span></div>
</div>
<strong><span style="color: blue; font-size: large;"></span></strong><br />
<div style="text-align: left;">
<span style="font-family: inherit;"><span style="vertical-align: baseline;"><span style="background-color: white; font-size: large;"><b></b></span></span></span><br />
<div style="text-align: center;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit;"><span style="font-size: large;"></span></span></span></span></div>
<strong><span style="color: blue; font-size: large;"></span></strong><br />
<span style="vertical-align: baseline;"><span style="background-color: white; font-family: inherit;"><span style="line-height: 20px;"><span style="color: blue; font-size: large;"><b></b></span></span></span></span><br />
<span style="vertical-align: baseline;"><span style="background-color: white; font-family: inherit;"><span style="line-height: 20px;"><span style="color: blue; font-size: large;"><b></b></span></span></span></span><br />
<strong><span style="color: blue; font-size: large;"></span></strong><br />
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"><span style="color: blue; font-weight: bold;"></span></span></span></span></span><br />
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; font-size: large; line-height: 20px;"></span></span></span><br />
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; font-size: large; line-height: 20px;"></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; font-size: large; line-height: 20px;"></span></span></span><br />
<span style="font-size: large;"></span></div>
<div>
<div style="text-align: center;">
<div style="font-weight: bold;">
<span style="vertical-align: baseline;"><span style="background-color: white;"><span style="font-family: inherit; line-height: 20px;"><span style="font-size: large;"></span></span></span></span></div>
<div style="text-align: left;">
<span style="vertical-align: baseline;"><span style="background-color: white; color: blue; font-size: 15px; line-height: 20px;"><b></b></span></span></div>
<div style="text-align: left;">
<span style="font-size: large;"></span></div>
<div style="text-align: center;">
<b style="color: blue; line-height: 20px; text-align: left;"><span style="font-size: large;"></span></b></div>
<div style="text-align: left;">
<span style="font-size: large;"></span></div>
<div style="text-align: center;">
<strong><span style="font-size: large;"></span></strong></div>
<div style="text-align: center;">
<span style="vertical-align: baseline;"><span style="background-color: white; font-size: large; line-height: 20px;"><b></b></span></span></div>
<div style="text-align: center;">
<span style="font-size: large;"><span style="vertical-align: baseline;"><span style="background-color: white; line-height: 20px;"><b></b></span></span></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/16284879849499817711noreply@blogger.com0