如何使用Gride View,Design& amp;创建3层架构代码 [英] How to Create 3 tier architecture with use of gride view, Design & Code

查看:82
本文介绍了如何使用Gride View,Design& amp;创建3层架构代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Asp.net语言的新手.

I''m Fresher in Asp.net Language

推荐答案

上周末有人问了有关三层开发的问题.让我告诉你,GridView完全无关紧要,如果你认为它是那么的话,那么你还有很长的路要走.记住,这并不容易,而且您必须阅读,学习,学习,练习,获得经验……另外,在这里,没有人能真正为您提供帮助,因为系统的设计对于每个人都是独一无二的系统,并取决于许多因素,例如工具,需求,语言,团队,时间,金钱...您为它命名!
所以这是我上次回答的内容,可能会对您有所帮助.

这不容易,也不容易解释.我建议您开始对此主题进行一些阅读.
首先,您必须了解面向对象编程 [封装 [继承 [ ^ ]和多态 [ 之后,您距离那里还很远. SOLID原则 [设计模式 [多层体系结构 [对象关系映射器(ORM) [实体框架 [ NHibernate [ ^ ]浮出水面.
中间层"包含业务逻辑.在这里,您可以对业务对象执行操作,例如计算销售订单或发票的总价.该层与您的数据层交互,但不与您的数据存储本身交互.
最后是UI层,您可以在其中向用户展示数据并允许用户与业务层进行交互. UI层的示例可以是WinForms,HTML和CSS或WPF前端.
Google有很多图像代表我刚才说的话, ^ ].

希望能帮助到你!祝你好运! :)
Last weekend someone asked a question about 3-tier development. Let me tell you this, a GridView is completely irrelevant and if you think it is then you''ve got a looooong way to go. Remember, it''s not easy and you''ll have to read, learn, study, practice, get experience... And another thing, no one here can really help you, since the design of a system is unique for every system and depends on many factors, such as tools, requirements, language, the team, time, money... You name it!
So here''s what I answered last time, it might help you.

It''s not easy, nor easy to explain. I suggest you start doing some reading on the subject.
First, you must understand Object Oriented Programming[^]. Make sure you get Encapsulation[^], Inheritance[^] and Polymorphism[^]. They are the ''three pillars of OOP''.
After that you are far from there yet. The SOLID principles[^] are key to building robust and re-usable software.
When you get all of these principles you may start reading up on Design Patterns[^].
All these will help you in building Multitier architected[^] software.

Basically, when it comes down to three tiers you have three layers of classes. A data layer, which will interact with your data store. Usually these are some classes that insert, delete, update and get data from a database. Many people use an Object Relational Mapper (ORM)[^] for this. In .NET Entity Framework[^] and NHibernate[^] come to mind.
The ''middle-tier'' contains business logic. Here you perform actions on your business object, like calculating the total price of a sales order or an invoice. This tier interacts with your data layer, but not with your data store itself.
Finally there is the UI layer, which is where you present your data to users and allow users to interact with the business layer. An example of a UI layer can be WinForms, HTML and CSS or WPF front ends.
Google has lots of images representing what I just said, take a look[^].

Hope it helps! Good luck! :)


这篇关于如何使用Gride View,Design& amp;创建3层架构代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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