久久久久久久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)方法的等價物是什么?

        What is the equivalent of static methods in ColdFusion?(ColdFusion 中靜態(tài)方法的等價物是什么?)
          <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)方法的等價物是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

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

                  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;
                      }
                  }
                  

                  然后在控制器中,我會通過簡單地使用來調(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 的實例來調(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)建一個實例的靜態(tài)"CFC,這樣我就可以像靜態(tài)一樣使用它,有點像 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?

                  推薦答案

                  不,你是對的,ColdFusion 中沒有靜態(tài)方法的概念.我認(rèn)為大多數(shù)人會通過在應(yīng)用程序啟動時創(chuàng)建的應(yīng)用程序范圍內(nèi)使用單例實用程序來解決這個問題.所以在你的 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)你需要從任何你會使用的地方調(diào)用它時:

                  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)方法的等價物是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                  onClick event for Image in Unity(Unity中圖像的onClick事件)
                  Running Total C#(運行總 C#)
                  Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                  asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                  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'>

                            主站蜘蛛池模板: 黑人巨大精品欧美一区二区免费 | 久久久国产一区 | 五月婷亚洲 | 亚洲一区在线播放 | h视频在线免费看 | 亚洲精品视频免费观看 | 成人天堂噜噜噜 | 无毛av | 久久久久国产一区二区三区不卡 | 激情欧美一区二区三区中文字幕 | 国产一区二区精品在线 | 欧美区在线 | 久久久久一区二区三区 | 成人精品久久 | 国产精品美女一区二区 | 亚洲精品一区二区三区四区高清 | 国产激情视频在线免费观看 | 国产在线一区二区三区 | 91偷拍精品一区二区三区 | 久久久久国产一区二区三区 | 亚洲日韩视频 | 视频二区 | 中文字幕精品一区二区三区精品 | va精品| 在线国产视频观看 | 亚洲一级视频在线 | 欧美亚洲日本 | 精品九九九| 综合久久久 | 国产精品免费一区二区三区四区 | 蜜臀网站| 日韩成人 | 日韩欧美在线一区 | 国产精品久久久久久久免费观看 | 国产精品一区二区在线 | 亚洲高清视频一区二区 | 欧美精品一区二区三区四区五区 | 97在线观视频免费观看 | av激情在线 | 天天弄 | 2018中文字幕第一页 |