久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='aarZ6'></bdo><ul id='aarZ6'></ul>
      1. <i id='aarZ6'><tr id='aarZ6'><dt id='aarZ6'><q id='aarZ6'><span id='aarZ6'><b id='aarZ6'><form id='aarZ6'><ins id='aarZ6'></ins><ul id='aarZ6'></ul><sub id='aarZ6'></sub></form><legend id='aarZ6'></legend><bdo id='aarZ6'><pre id='aarZ6'><center id='aarZ6'></center></pre></bdo></b><th id='aarZ6'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aarZ6'><tfoot id='aarZ6'></tfoot><dl id='aarZ6'><fieldset id='aarZ6'></fieldset></dl></div>
      2. <legend id='aarZ6'><style id='aarZ6'><dir id='aarZ6'><q id='aarZ6'></q></dir></style></legend>
        <tfoot id='aarZ6'></tfoot>

        <small id='aarZ6'></small><noframes id='aarZ6'>

        ColdFusion 中靜態(tài)方法的等價(jià)物是什么?

        What is the equivalent of static methods in ColdFusion?(ColdFusion 中靜態(tài)方法的等價(jià)物是什么?)
          <tfoot id='N3Q0a'></tfoot>

          1. <small id='N3Q0a'></small><noframes id='N3Q0a'>

            <i id='N3Q0a'><tr id='N3Q0a'><dt id='N3Q0a'><q id='N3Q0a'><span id='N3Q0a'><b id='N3Q0a'><form id='N3Q0a'><ins id='N3Q0a'></ins><ul id='N3Q0a'></ul><sub id='N3Q0a'></sub></form><legend id='N3Q0a'></legend><bdo id='N3Q0a'><pre id='N3Q0a'><center id='N3Q0a'></center></pre></bdo></b><th id='N3Q0a'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='N3Q0a'><tfoot id='N3Q0a'></tfoot><dl id='N3Q0a'><fieldset id='N3Q0a'></fieldset></dl></div>

              • <legend id='N3Q0a'><style id='N3Q0a'><dir id='N3Q0a'><q id='N3Q0a'></q></dir></style></legend>
                  <tbody id='N3Q0a'></tbody>
                  <bdo id='N3Q0a'></bdo><ul id='N3Q0a'></ul>

                  本文介紹了ColdFusion 中靜態(tài)方法的等價(jià)物是什么?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  在 C# 中,我創(chuàng)建了靜態(tài)方法來幫助我執(zhí)行簡(jiǎn)單的操作.例如:

                  In C#, I created static methods to help me perform simple operations. For example:

                  public static class StringHelper
                  {
                      public static string Reverse(string input)
                      {
                          // reverse string
                          return reversedInput;
                      }
                  }
                  

                  然后在控制器中,我會(huì)通過簡(jiǎn)單地使用來調(diào)用它:

                  Then in a controller, I would call it by simply using:

                  StringHelper.Reverse(input);
                  

                  現(xiàn)在我將 ColdFusion 與 Model Glue 一起使用,我想做同樣的事情.但是,ColdFusion 中似乎沒有靜態(tài)方法的概念.如果我這樣創(chuàng)建 CFC:

                  Now I'm using ColdFusion with Model Glue, and I'd like to do the same thing. However, it seems like there's no concept of static methods in ColdFusion. If I create a CFC like this:

                  component StringHelper
                  {
                      public string function Reverse(string input)
                      {
                          // reverse string
                          return reversedInput;
                      }
                  }
                  

                  我只能通過在控制器中創(chuàng)建 StringHelper 的實(shí)例來調(diào)用此方法嗎,如下所示:

                  Can I only call this method by creating an instance of StringHelper in the controller, like this:

                  component Controller
                  {
                      public void function Reverse()
                      {
                          var input = event.getValue("input");
                          var stringHelper = new StringHelper();
                          var reversedString = stringHelper.Reverse(input);
                          event.setValue("reversedstring", reversedString);
                      }
                  }
                  

                  或者是否有一些地方可以放置框架將在幕后創(chuàng)建一個(gè)實(shí)例的靜態(tài)"CFC,這樣我就可以像靜態(tài)一樣使用它,有點(diǎn)像 helpers 文件夾的工作原理?

                  Or is there some place where I can put 'static' CFCs that the framework will create an instance of behind the scenes so I can use it as if it was static, kind of like how the helpers folder works?

                  推薦答案

                  不,你是對(duì)的,ColdFusion 中沒有靜態(tài)方法的概念.我認(rèn)為大多數(shù)人會(huì)通過在應(yīng)用程序啟動(dòng)時(shí)創(chuàng)建的應(yīng)用程序范圍內(nèi)使用單例實(shí)用程序來解決這個(gè)問題.所以在你的 App.cfc 中 onApplication 開始你可能有:

                  Nope, you are correct, there is no concept of static methods in ColdFusion. I think most would solve this problem through the use a singleton utilities in the application scope that are create when the application starts. So in your App.cfc in onApplication start you might have:

                  <cfset application.StringHelper = createObject("component", "path.to.StringHelper") />
                  

                  然后當(dāng)你需要從任何你會(huì)使用的地方調(diào)用它時(shí):

                  Then when you needed to call it from anywhere you would use:

                  <cfset reversedString = application.StringHelper.reverse(string) />
                  

                  是的,它不像靜態(tài)方法那樣干凈.也許有一天我們可以擁有類似的東西.但現(xiàn)在我認(rèn)為這是你將得到的最接近的.

                  Yeah, it's not as clean as static methods. Maybe someday we could have something like them. But right now I think this is as close as you will get.

                  這篇關(guān)于ColdFusion 中靜態(tài)方法的等價(jià)物是什么?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測(cè)有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運(yùn)行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時(shí)刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時(shí)突出顯示行)
                  Calling A Button OnClick from a function(從函數(shù)調(diào)用按鈕 OnClick)
                • <tfoot id='0TJvY'></tfoot>

                  1. <legend id='0TJvY'><style id='0TJvY'><dir id='0TJvY'><q id='0TJvY'></q></dir></style></legend>
                      <bdo id='0TJvY'></bdo><ul id='0TJvY'></ul>

                            <tbody id='0TJvY'></tbody>
                        1. <i id='0TJvY'><tr id='0TJvY'><dt id='0TJvY'><q id='0TJvY'><span id='0TJvY'><b id='0TJvY'><form id='0TJvY'><ins id='0TJvY'></ins><ul id='0TJvY'></ul><sub id='0TJvY'></sub></form><legend id='0TJvY'></legend><bdo id='0TJvY'><pre id='0TJvY'><center id='0TJvY'></center></pre></bdo></b><th id='0TJvY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0TJvY'><tfoot id='0TJvY'></tfoot><dl id='0TJvY'><fieldset id='0TJvY'></fieldset></dl></div>
                          • <small id='0TJvY'></small><noframes id='0TJvY'>

                            主站蜘蛛池模板: 亚洲天堂男人的天堂 | 中文字幕日韩欧美一区二区三区 | 欧美一区二区在线播放 | www.国产精品 | 久久久国产精品视频 | 国产亚洲精品久久19p | 99精品视频在线观看免费播放 | 日韩第一夜 | 久草网站 | 日韩中文在线视频 | 一区二区三区在线免费观看视频 | 亚洲网在线 | 狠狠综合久久av一区二区小说 | 成人av一区二区三区 | 久久综合狠狠综合久久综合88 | 国产精品视频网 | 亚洲精品久久久久中文字幕欢迎你 | 精久久 | 亚洲欧洲成人 | 波多野结衣精品 | 亚洲一区二区三区免费观看 | 91久久久精品国产一区二区蜜臀 | 欧美成人免费在线视频 | 日韩视频一区二区三区 | 一区二区不卡高清 | 中文字幕在线观看一区 | 国产精品久久久久久亚洲调教 | 99精品一区二区 | 影音先锋中文在线 | 国产精品乱码一区二三区小蝌蚪 | 国产精品视频中文字幕 | 999久久久 | 一区二区三区四区在线视频 | 天天天操天天天干 | 婷婷综合五月天 | 日本一区二区高清不卡 | 久久综合伊人 | 国产网站在线播放 | 午夜精品一区二区三区免费视频 | 日韩欧美三级电影在线观看 | 日韩精品一区二区三区中文字幕 |