Separating Your Concerns- Antidote to Smart UI Part 2

..Honestly to be mentioned.. i have completed the third chapter..and there are lot new stuff which i am unaware of it …it took me for a while to understand some concepts.. i really hope.. i will get my self a clear understanding after completing this Separating Your Concerns- Antidote to Smart UI series…

in the Book.. first Domain model has been presented and then parts like web services,infrastructure, repo model were built on Domain model.. finally developing Presentation layer/User Experience Layer..

But In this series i will first start with Presentation Layer…as i said i want to be clear about what i have done in this series..instead of just putting what is in the book

The below diagram represents the architecture flow which we are going to develop..

before going in to Presentation layer.. lets build our database as we have done in AntiPattern

  • Create a database in the WebUI project with the same schema, name, and data that you used in the Smart UI exercise
  • User Experience Layer

  • Open the default.aspx source view and edit the HTML markup so it matches what follows:
  • <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
       
    <asp:DropDownList AutoPostBack="true" ID="ddlCustomerType" runat="server">
    <asp:ListItem Value="0">Standard</asp:ListItem>
    <asp:ListItem Value="1">Trade</asp:ListItem>
    </asp:DropDownList>
    <asp:Label ID="lblErrorMessage" runat="server" ></asp:Label>
    <asp:Repeater ID="rptProducts" runat="server" >
    <HeaderTemplate>
    <table>
    <tr>
    <td>Name</td>
    <td>RRP</td>
    <td>Selling Price</td>
    <td>Discount</td>
    <td>Savings</td>
    </tr>
    <tr>
    <td colspan="5"><hr /></td>
    </tr>
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
    <td><%# Eval("Name") %></td>
    <td><%# Eval("RRP")%></td>
    <td><%# Eval("SellingPrice") %></td>
    <td><%# Eval("Discount") %></td>
    <td><%# Eval("Savings") %></td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
    </asp:Repeater>
    
    </asp:Content>
    
    

    if you compare the code with Smart UI AntiPattern, this is super clean.. there are no database bound controls in UI.. there are no delete/update/select database bounded controls here…

    For now don’t worry about code behind file..i will revisit this section later again in the series..

    Advertisements

    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s