[ Pobierz całość w formacie PDF ]
.This allows developersto quickly create an organized list showing parent-childrelationships by simply dropping a control and setting acouple of properties, and ensures display consistencyacross the website.(d)Separation of UI and CodeAnother benefit of ASP.Net is an improved separation of thecode from the user interface (UI).One of the largestproblems facing developers building large, traditional ASPapplications is the combination of design and code in asingle page.The UI defined by the HTML in a traditionalASP is often inextricably tied to the code used to modifythe UI.This not only makes maintenance of both the UI andthe code much more difficult, it makes the initial creationof the page more complicated as well.Several challenges arise from the fact that both the UIdesigner and the code developer have to modify a single setof code.The most obvious is that the designer and thedeveloper cannot work on the page at the same time.Thesecond challenge is the potential for one to inadvertentlyalter the other's work, breaking either the form or thefunctionality.Web forms largely eliminate this problem byenabling "code-behind" classes, where the event handlersfor a web page are stored in a separate file.This allowsthe designer to create the.aspx page while the developerworks on a.vb page which contains code for the.aspx page.The two pages are tied together through the CodeBehindattribute of the Page directive.NET e-Business Architecture Page 39 of 41Chapter 05 Implementing.NET Presentation ServicesWhile it is still possible to use traditional inlinescripting instead of code behind, it is stronglyrecommended that code behind is used whenever possible.Theadded maintainability of the code easily justifies thesmall learning curve needed to adjust to the new style ofASP programming.The samples in this book and the gasTIXwebsite use code behind exclusively, as demonstrated inListing 5.4.***BEGIN LISTING***Listing 5.4The Code Behind Page for gasTIX Search Pages Sets the TextProperty of the lblHeader ControlCode Sample: Each gasTIX search page has a Label web control defined bythe designer; all the developer needs to know is the name.Dim SC As New gasTIX.BusinessFacade.Subcategory()Dim dvXML As DataViewDim dsTemp As New DataSet()dsTemp.ReadXml(New StringReader(SC.ListParticipants(Request.QueryString("SubCategory_ID").ToInt32())))If Request.QueryString("debug") "" Thenresponse.Write(Request.QueryString("Name"))Response.Write(server.htmlencode(SC.ListParticipants(Request.QueryString("SubCategory_ID").ToInt32())))End IfIf dsTemp.Tables.Count > 0 ThendvXML = dsTemp.Tables("Participant").DefaultViewWith rptParticipants.DataSource = dvXML.DataBind()End WithElselblNoRecords.Text = "There are no participants in thissubcategory."End IflblHeader.Text = "Participants in theCategory.SubCategory Name(" & rptParticipants.Items.Count & " records found)"***END LISTING***.NET e-Business Architecture Page 40 of 41Chapter 05 Implementing.NET Presentation ServicesEach results page in the gasTIX Search application has aLabel web control defined on the page to indicate to theuser the search for which the results are presented and thenumber of results found.For example, if the user clicksthe "Celtic" subcategory on the home page, the results pagedisplays a label indicating that one record was found inthe "Music.Celtic" category.Since the developer knowsthat a web control named "lblHeader" will be presentsomewhere on the page, he simply instructs the code behindpage to specify the text property of the label.He neverneeds to know the style or location of the label, just itsname.(c)From HereASP.Net finally brings the benefits of object-orientedprogramming into the world of web development.ASP.Netfeatures much better encapsulation and reusability thenever before, allows developers and designers to workseparately on a single project, and allows developers towrite code in the language of their choice.In addition,performance improvements, enhanced security, andinteroperability with the.Net servers make ASP.Net anexcellent choice for larger scale, enterprise criticalapplications.NET e-Business Architecture Page 41 of 41Chapter 05 Implementing.NET Presentation Services(a)6(b)Implementing.NET Business Servicesby Eric Brown(a)6.1(b)Implementing.NET Business Services.1(c)Architectural Goals.2(d)Interoperability.2(d)Performance.2(d)Availability.2(d)Scalability.2(d)Security.2(c)gasTIX Business Services--A closer look.2(d)Business Façade.2(d)Business.2(d)Data.2(d)Data Access.2(d)System Framework.2(d)Web Services.2(c)What's New for Component Development?.2(d)Remoting versus DCOM.2(d)ADO.NET.2(e)DataReader.2(e)Dataset.2(e)XML view of data.2(e)Typed Datasets.2(c)From Here.2The business services layer of the gasTIX application is thetier that is responsible for enforcing business rules,processing information, and managing transactions.It is in thebusiness services layer that a developer builds reusablecomponents.Business services components are not tied to anyspecific client, and can service multiple applications, as wellas reside in separate locations from the clients.The businessservices layer is critical to applications, even though it doesnot create the look and feel of the application.With the introduction of.NET, Microsoft has made one of themost significant platform changes since the introduction ofWindows to the DOS world.These changes are far morecomprehensive than just simple language changes, or the creationof a new language.Many of the changes in.NET affect theimplementation of.NET business services, including the.NET e-Business Architecture Page 1 of 28Chapter 06 Implementing.NET Business Servicesframework classes, remoting, and web services, just to name afew.If developers are not prepared for the changes ahead, theymay find themselves left behind on the learning curve.Due to this platform shift, many developers and architects alikeare asking how the implementation of enterprise applications andbusiness services will change from Windows DNA to.NET.Perhapsthey should also be asking how all these changes affect thedesign of enterprise applications and business services, as wellas what should be the items one thinks about when architecting.NET applications.The architectural goals for gasTIX wouldhave remained the same, regardless of the implementationplatform.However, the actual design of gasTIX does vary inresponse to the implementation platform.The introduction of the.NET platform has therefore affected both the gasTIX applicationdesign and implementation.This chapter begins by discussing thearchitectural goals of gasTIX.The chapter then covers thedesign of the gasTIX Business Services and also covers thereasons behind some of the design choices.Lastly the focus ison what is new in component development with.NET.(c)Architectural GoalsThe team that was formed to design gasTIX consisted of severalexperienced Windows DNA architects and designers.Each teammember had previously participated in the design andconstruction of enterprise-class applications
[ Pobierz całość w formacie PDF ]