我是.NET的新手 - 我应该怎么集中注意什么呢? [英] I'm new to .NET - what should I concentrate on and what should I ignore?

查看:113
本文介绍了我是.NET的新手 - 我应该怎么集中注意什么呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我已经有了大量的使用php和coldfusion编程数据库驱动的网络应用程序的经验(不一起在不同的时间),我开始研究asp.net世界(我有一个项目来了在工作中,所有的asp.net/c#。)

So, I've had a fair amount of experience programming database driven web apps using php and coldfusion (not together, at different times) and I'm starting to look into the asp.net world (I have a project coming up at work that is all asp.net/c#.)

我的问题是:似乎有很多的东西被困扰如果我只是制作基于网络的应用程序(主要是CRUD类型的东西 - 没有思维逻辑),我应该关注的是什么主题?我只是不想下来一些东西的兔子踪迹,以后发现它并没有被开发社区太多使用。在阅读一些书(ASP.net 3.5一步一步,ASP.net 3.5释放)我找到一个区域的主题将被解释,但在本章结尾,它会说这东西很酷,但不是在多层应用程序中使用...

My question is: there seems to be a lot of stuff to get mired in and if I'm just making web-based applications (mostly CRUD-type stuff - no mind-bending logic) what are the topics I should be focusing on? I just don't want to go down the rabbit trail of something to find out later that it's not really used too much by the development community. In reading some books (ASP.net 3.5 step by step and ASP.net 3.5 unleashed) I'm finding some area's where a topic will be explained but at the end of the chapter it'll say "this stuff is cool but not for use in multi-tiered applications..."

目前为止我已经看过的主题(与用于构建的应用程序似乎有很大不同)是:

The topics I've looked at so far (that seem to differ greatly from the applications I'm used to building) are:


  • 主页

  • DataBinding

  • 到SQL

  • ASP.NET MVC

  • 模板和数据绑定表达式

  • asp.net控件

  • Master pages
  • DataBinding
  • Linq to SQL
  • ASP.NET MVC
  • Templates and databinding expressions
  • asp.net controls

我知道这可能是一个广泛的问题 - 但这似乎是一个广泛的话题。

I know this may be a broad question - but this seems to be a broad topic.

推荐答案

好问题!我假设你可以随时拿起C#语法,所以我将重点放在大局。

Good question! I'm assuming that you can pick up the C# syntax as you go so I'll focus on the big picture.

要开始使用WebForms应用程序, em>必须了解页面生命周期和应用程序生命周期。这是您的首要任务。 ASP.NET使用的模型基于Windows基于窗体的编程,这对您对整个软件生产过程的看法有影响。现在,我假设您将构建一个WebForms应用程序,因为WebForms技术(在ASP.NET中)更加成熟,拥有更好的第三方支持,并拥有更多的文档。如果你倾向于MVC,那么请记住,一个好的设计将是一个或者另一个 - MVC不是WebForms的一部分,它是另一种选择。

To get started with a WebForms application, you must understand the page lifecycle and the application lifecycle. This is your first priority. The model used by ASP.NET is based on Windows form-based programming and this has implications for how you think about the entire software production process. Now, I'm assuming that you will be building a WebForms application because WebForms technology (in ASP.NET) is more mature, has better third-party support and has far more documentation. If you are inclined to MVC, then just keep in mind that a good design will be one or the other - MVC isn't a part of WebForms, it is an alternative to it.

接下来,你有一些决定。您将使用标准数据访问(例如SQLClient)工具,滚动您自己的数据访问层(或使用DAL)还是使用linq to SQL?我说决定,因为团队中的每个人都必须在一起。我衷心建议您建立一个DAL,您可以根据需要进行优化。 Linq也很好,但是有一些地平线上不祥的云层。协调,决定并留下来。

Next, you have some decisions. Will you be using standard data access (e.g. SQLClient) tools, rolling your own data access layer (or using DAL), or using linq to SQL? I say "decisions" because everyone on the team will have to be together on this one. I heartily recommend building a DAL as you can optimize it for your needs. Linq is nice as well but there are some ominous clouds on the horizon. Coordinate, decide and stay with it.

虽然不是强制性的,但您应该认真考虑在单独的类库(DLL)中构建您的业务逻辑。 Visual Studio / ASP.NET使得创建自己的类库非常容易,并将其折叠到您的解决方案中。了解如何做到这一点,你将成为一个更好的开发人员多年。人们通常认为这样做是为了将您的用户界面与数据访问隔离开来。尽管如此,这并不是真正的优势 - 当您准备好学习和进行单元测试时,优势在于道路。刚开始,假设你会从逻辑上拆分UI,你会非常感谢我。

While not mandatory, you should seriously consider building your Business Logic in a separate Class Library (DLL). Visual Studio / ASP.NET make it trivially easy to create your own Class Library and to fold it into your solution. Learn how to do this and you'll be a better developer for years. People usually argue for this on the basis that it will insulate your UI from your data access. While true, that isn't really the advantage - the advantage comes down the road when you are ready to learn and do Unit testing. Just start out with the assumption that you'll split UI from logic and you'll thank me down the road.

在这一点上,你可以(A)构建Web页面和(B)在其中显示动态的基于数据库的内容。确保您掌握了GridView和用于填充它们的ObjectDataSource对象。注意:ObjectDataSource是从Business Class Library到您的UI的数据。如果您不使用业务层,那么您将使用SQLDataSource或LinqDataSource对象直接从UI访问您的数据。

At this point, you can (A) build web pages and (B) show dynamic, database-based content in them. Make sure that you master the GridView and the ObjectDataSource objects used to fill them. Note: the ObjectDataSource is what shuttles data from your Business Class Library to your UI. If you don't use a Business Layer, then you'll use SQLDataSource or LinqDataSource objects to access your data directly from the UI.

不要在您的架构尚未!

您现在需要决定是否要使用Microsoft的WebParts,登录和导航组件。这些锁定您的网站导航,UI等特定方法,但可以节省您适当的时间。

You now need to decide whether you want to use Microsoft's WebParts, Login and Navigation components. These lock you in to a specific approach to site navigation, UI, etc. but can save you loads of time if appropriate.

一旦你知道你是否会使用这些和你有机会习惯他们,然后我会建议熟悉主页。我广泛使用它们,它们非常适合标准化网站的整体外观。

Once you know if you'll be using these and you have had a chance to get used to them, then I would recommend getting familiar with Master Pages. I use them extensively and they are great for standardizing the overall look and feel of the site.

最后,每个专业的ASP.NET开发人员必须获得自己的Page类(例如MyPageClass),以便它们可以在页面级别上封装常见的操作。例如,我已经构建了会话管理对象,以便我可以以类型安全的方式访问我所有常用的会话变量。派生页面类负责提供sessionObj实例,以便每个页面都可以访问它,而无需任何额外的工作。

Finally, every professional ASP.NET developer must derive their own Page class (e.g. "MyPageClass") so that they can encapsulate common actions at the Page level. For example, I've built a session management object so that I can access all of my commonly-used session variables in a type-safe manner. The derived page class is responsible for providing the sessionObj instance so that every page can access it without any additional work.

现在您已准备好开始构建企业级网络应用程序!

Now you are ready to begin building an enterprise class web app!

这篇关于我是.NET的新手 - 我应该怎么集中注意什么呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆