Jump to content

User:Whitehacker00/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Whitehacker00 (talk | contribs) at 16:07, 31 March 2023 (Added links, citations, headings and smoothes out the page layout). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

වස්තු-ක්‍රමලේඛන භාෂාව (Object-oriented programming)


Object-oriented programming (OOP) යනු දත්ත සහ කේත අඩංගු විය හැකි "වස්තු" (objects) වල සංකල්පය මත පදනම් වූ ක්‍රමලේඛන ආදර්ශයකි (programming paradigm). දත්ත ක්ෂේත්‍ර ස්වරූපයෙන් ගුණාංග (attributes) ලෙස හැඳින්වේ. කේතය ක්‍රියා පටිපාටි ආකාරයෙන් ක්‍රම (methods) ලෙස හැඳින්වේ.

වස්තූන්හි පොදු ලක්ෂණයක් වන්නේ ඒවාට අනුයුක්ත කර ඇති වස්තුවේ දත්තක්ෂේත්‍ර වෙත ප්‍රවේශ වීමට සහ වෙනස් කිරීමට හැකිවීමනි. සාමාන්‍යයෙන්, මෙම වස්තුව හැඳින්වීමට විශේෂ නම් this හෝ self භාවිතා කරයි. OOP ආදර්ශකයේ, පරිගණක වැඩසටහන් නිර්මාණය කර ඇත්තේ ඒවා එකිනෙක හා අන්තර් ක්‍රියා කරන වස්තු වලින් සමන්විත වීමෙනි.

OOP භාෂා විවිධ වේ. එනම් වර්ග දෙකකි :

1. පන්ති මත පදනම් වූ භාෂා (class-based) : වස්තූන්හි තත්වය සහ ක්‍රියාකාරීත්වය පන්ති සාමාජිකයින්ට අනුව ලබා දෙන අතර ඒවායේ වර්ග (type) ද තීරණය කරයි.

2. මූලාකෘති මත පදනම් වූ භාෂා (prototype-based) : වස්තූන් මූලාකෘති වස්තුවෙන් (prototype object) ක්‍රියාකාරීත්වය ලබා ගනී.

නමුත් වඩාත්ම ජනප්‍රිය පන්ති මත පදනම් වූ භාෂා වර්ගය වේ. [1][2]

බහුලව භාවිතා වන බොහෝ OOP භාෂා (උදා: C++, Java, Python) බහු සුසමාදර්ශ / බහු-පරම (multi-paradigm) වේ. ඒවා සාමාන්‍යයෙන් අත්‍යවශ්‍ය (imperative) සහ ක්‍රියා පටිපාටි වැඩසටහන් (procedural programming) සමඟ ඒකාබද්ධව OOP වැඩසටහන් වලට අඩු වැඩි මට්ටමකින් සහාය වේ.

සැලකිය යුතු මට්ටමින් OOP භාෂාවලට ඇතුළත් වන්නේ : Ada, ActionScript, C++, Common Lisp, C#, Dart, Eiffel, Fortran 2003, Haxe, Java, JavaScript, Kotlin, logo, MATLAB, Objective-C, Object Pascal, Perl, PHP, Python, R, Raku, Ruby, Scala, SIMSCRIPT, Simula, Smalltalk, Swift, Vala සහ Visual Basic.NET.[3]

බාහිර සබැඳුම් (References)

  1. ^ Kindler, Eugene; Krivy, Ivan (2011). Object-oriented simulation of systems with sophisticated control. Vol. 40. International Journal of General Systems. pp. 313–343.
  2. ^ Lewis, John; Loftus, William (2008). Java Software Solutions Foundations of Programming Design (6th ed.). Pearson Education Inc. pp. section 1.6 "Object-Oriented Programming". ISBN 978-0-321-53205-3.
  3. ^ "A Research on Object Oriented Programming and Its Concepts". International Journal of Advanced Trends in Computer Science and Engineering. 10 (2): 746–749. 2021-04-05. doi:10.30534/ijatcse/2021/401022021. ISSN 2278-3091.