問題描述
作為一個使用 Adob??e 的 ColdFusion 編寫 Web 應用程序大約 10 年的人,我決定將 ASP.NET 作為字符串添加到我的弓上.
As someone who has spent around 10 years programming web applications with Adobe's ColdFusion, I have decided to add ASP.NET as a string to my bow.
對于長期使用 CF 和底層 Java 的人來說,ASP.NET 對我來說似乎有點陌生.我應該如何開始使用 ASP.NET,這樣我才能真正危險地使用它?我需要非常詳細地了解 C# 嗎?
For someone who has spent so long with CF and the underlying Java, ASP.NET seems a little alien to me. How should I go about getting up to speed with ASP.NET so that I can be truly dangerous with it? Do I need to know C# at any great amount of detail?
我希望能夠快速構建基本的網絡應用程序,這樣我就可以學習更多做棘手的事情.
I want to be in a position where I can build basic web apps fairly quickly so I can learn more doing the tricky stuff.
推薦答案
我可能只有六個月的時間走同樣的路,但以下是我迄今為止的經驗中的一些想法:
I'm only maybe six months down the same path, but here are some thoughts from my experience so far:
如果您完全有 Java(甚至 CFScript)方面的經驗,那么 C# 語言應該不會給您帶來太多問題.不過,作為參考,當我開始時,我發現 csharp-station 是一個很好的語言入門基本.就 ASP.NET 而言,它對您沒有多大幫助;但它對語法有好處.更多您將熟悉 .NET 庫.IDE 實際上可以在這里提供巨大的幫助.
The C# language shouldn't give you much problem if you have very much experience with Java at all (or even CFScript). As a reference, though, when I was starting, I found csharp-station a good primer for language basics. It won't help you much as far as the ASP.NET side goes; but it is good for syntax. More you'll be familiarizing yourself with the .NET libraries. The IDE actually can be an enormous help here.
以下是我在進行過渡時發現的三個最大差異:
Here are the three biggest differences I found making the transition:
- ASP.NET 服務器控件 - 在 ColdFusion 中,您確實擁有漂亮的直接控制 HTML;你與頁面密切合作.情況并非如此ASP.NET.服務器控件是旨在減輕你的很多乏味,但可能要付出一些代價直接控制.作為一名CF程序員,我對得到的東西很挑剔實際輸出到瀏覽器;和起初 ASP.NET 讓我很沮喪因為它會吐出很多額外的東西代碼.盡管如此,控件仍然是真的很強大,而且值得熟悉他們.表單和驗證控件,尤其是,讓你免于很多CF中處理帖子的乏味返回和驗證.W3學校實際上有一個不錯的 網絡列表服務器控件.
- 頁面模型 - ColdFusion 在頁面方面是相當不可知的流動.ASP.NET 非常適合傾向于使用后背,并且是非常事件驅動.如果你不是使用帶有 CF 的框架(例如模型膠),這可能是陌生的你..NET 負責處理很多回發行為你.還有,不是說ColdFusion 不能成為對象并且良好使用驅動的功能CFC 的,但 ASP.NET 確實試圖將您推向 OO 路徑比較以我的經驗為 CF.
- 數據庫訪問 - 使用 ASP.NET 真的讓我很感激強大的cfquery 真的是.這csharp-station網站也有不錯的使用本機的教程.NET 數據庫工具.我沒有工作足夠的項目尚未開始尋找用于數據庫訪問擴展;我是很確定杰夫推薦他們用來做的東西建立這個網站,所以你可以檢查出.不然我真的建議你熟悉一下與 DataSet 對象.它是有點類似于查詢對象在 CF 中,并讓您運行查詢查詢等...循環CF 中的查詢很常見,但它幾乎沒有發生ASP.NET 因為數據綁定.
- ASP.NET Server Controls - In ColdFusion, you really have pretty direct control over the HTML; you work very closely with the page. This isn't so much the case in ASP.NET. The server controls are meant to relieve you of a lot of the tedium, but at a cost of maybe some direct control. As a CF programmer, I'm very particular about what gets actually output to the browser; and at first ASP.NET frustrated me because it spits out a lot of extra code. Still, the controls are really powerful, and it pays to familiarize yourself with them. Form and validation controls, especially, save you from a lot of the tedium in CF of handling post back and validation. W3Schools actually has a decent list of web server controls.
- The page model - ColdFusion is pretty agnostic in terms of page flow. ASP.NET is very much geared towards using post backs, and is very event driven. If you're not using a framework with CF (e.g. Model Glue), this may be foreign to you. .NET takes care of handling a lot of the post back behavior for you. Also, not to say that ColdFusion can't be object and function driven by good use of CFC's, but ASP.NET really tries to push you down the OO path compared to CF in my experience.
- Database access - Using ASP.NET really made me appreciate how powerful cfquery really is. The csharp-station site also has a good tutorial on working with the native .NET db tools. I haven't worked on enough projects yet to start looking around for DB access extensions; I'm pretty sure Jeff recommended something that they used for building this site, so you might check that out. Otherwise, I really suggest you familiarize yourself with the DataSet object. It's somewhat similar to a query object in CF, and lets you run query of queries, etc... Looping over queries in CF is very common, but it doesn't happen nearly as much in ASP.NET because of data binding.
這篇關于作為 ColdFusion 開發人員,您應該如何學習 ASP.NET?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!