<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          jOOPLJavaScript 面向?qū)ο罂蚣?/h1>

          聯(lián)合創(chuàng)作 · 2023-09-22 12:16

          jOOPL 是一個(gè) JavaScript 面向?qū)ο罂蚣?,全稱(chēng)是:"JavaScript Object-Oriented Programming Library".

          是一個(gè)輕量級(jí)、易用的面向?qū)ο缶幊處?kù),允許使用純 JavaScript 實(shí)現(xiàn)高級(jí)面向?qū)ο筇匦?,包括?

          • 繼承. 
          • 多態(tài)
          • 封裝
          • 組合

          示例代碼:

          // First of all, we are going to declare a namespace for the class
          $namespace.register("Joopl.Samples");
          
          // Next part will be about designing the whole class
          Joopl.Samples.Polygon = $class.declare(
          // The constructor
          function() {
              // This is very recommended: if you declare a class field in the constructor,
              // it will hold a default value instead of undefined
              this.$_.args = null;
          },
          {
            // Sets an object that will hold the arguments to calculate the polygon's area
            set_Args: function(value) {
              this.$_.args = value;
            },
            
            // Gets an object that will hold the arguments to calculate the polygon's area
            get_Args: function() {
              return this.$_.args;
            },
            
            // The method to calculate the area. Check that its body does implement nothing.
            // Derived classes will be the ones responsible of providing the formula to make the calculation.
            CalculateArea: function() {
            }
          }
          );
          瀏覽 38
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)

          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美色图9 | 九九九九九九九九精品 | 天天爽夜夜爽夜夜爽精品 | 97骚逼 | 国产AV资源 |