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

问题描述

所以,我已经使用PHP和ColdFusion编程经验的数据库驱动的web应用程序相当数量(不在一起,在不同的时间),我开始寻找到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#.)

我的问题是:人们似乎的的东西很多的获得深陷在如果我只是做基于Web的应用程序(主要是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:


  • 母版页

  • 数据绑定

  • 的Linq到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的应用程序,您必须的理解页面的生命周期和应用程序生命周期。这是你的首要任务。由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是很好很好,但也有一些 href=\"http://vistadb.net/blog/news/microsoft-killing-linq-to-sql/\">不测之风云。协调,决定并坚持下去。

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)网络建设页和(B)示出在其中动态,基于数据库的内容。请确保你掌握了GridView和用于填充它们的ObjectDataSource对象。注:ObjectDataSource控件是从穿梭您的业务类库数据到你的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.

不要在您的解决建筑呢!

Don't be settling on your architecture yet!

您现在需要决定是否要使用微软的的WebParts,登录和导航组件。这些你锁在一个特定的方式来网址导航,用户界面​​等,但如果合适的话可以为您节省大量的时间。

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.

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

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

这篇关于我是新来的.NET - 我应该怎么集中精力,我应该忽略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:04