Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Project Cognizant standard

Note:
Project should be 3 tier project.(BAL(class library),DAL(class library) and Web UI(web application) are separate projects There can be 5 layers in a project. Namely: o WebUI layer(Presentation layer) [Example:Cognizant.Dotnet.RailwayReservation.WebUILayer] The above layer should have the following file and folders. webConfig file Master pages o There can be any number of master pages in an application o They can be inherited, nested Templates o Templates are set of controls placed inside a separate container. o We can have User controls. Webpages o If the project is RailwayReservation, we can have these folders as given below o Account Login.aspx Registration.aspx passwordRecovery.aspx o TrainDetails TrainAvailability.aspx And others.. o BookingProcess Booking.aspx Cancellation.aspx Etc. o Web.config file to allow or restrict the users. o Need Global.asax to be used. Styles o <link> tag can be placed inside the <head> </head>tag o We should have only external style definition o MasterPageName.Css should be the file name for the external style sheets

LENAPRASANNA MANI, 346238

Scripts o Javascript folder o JQuery folder (It is not mandatory. But it is a good practice.) o <script type=text/javascript> </script>tag shall be placed at the end of <body> tag. Images o Logos folder o Backgrounds o Trains(Optional) o BookingImages (Optional) CustomErrorPages o 404 error- page not found error o 403 error- no access error o Include this lines in webConfig.xml page <customErrors mode=on defaultRedirect=Default.aspx> <Error code=404 redirect=Unknown.aspx/> <Error code=403 redirect=Authorization.aspx/> </customErrors>

Business layer [Example: Cognizant.DotNet.RailwayReservation.BusinessLayer] Rename the default class1.cs as AccountBusinessClass.cs Add new Item .. and add all other classes TrainDetailsBusinessClass TicketBookingBusinessClass Keep a file called ExceptionLog.txt which stores the exceptions occurred .it can be filled from global.asax application error. Open the file using FileStream class and append contents onto it by StreamWriter classs write() method and finally store the current date and time onto it. (this enables user to identify when the exceptions are occurred). Use exception handling. Try,catch,and finally method should be used. Finally block should be used to release all the resources. Example: inside finally block, we can use objLoginEntity=null; Use of using keyword should be practised which disposes objects automatically when the control exits using block. Nested using is also possible. Entity layer Class names in entity layer should be like AccountEntityClass.cs, TrainDetailsEntityClass Objects should be given with a proper naming conventions like entLogin or objLoginEntity Use exception handling. Try,catch,and finally method should be used.

LENAPRASANNA MANI, 346238

Data layer Class names in data layer should be like AccountDataClass.cs, TrainDetailsDataClass Objects should be given with a proper naming conventions objLoginData Include comments for each method. Application Configuration file (App.Config) to establish connection Webservice (Use this whenever needed. It is project specific.)

WebUI Layer Considerations: Source o Can have Master page and other pages o Proper Layout (div or table) o Proper Naming conventions to controls o Avoid &nbsp, avoid more <br/> o No inlne styles o Dont use absolute positioning to any controls o WebUI - Code behind layer o Can have Event handlers o No Exceptional handling ( in MFRP and guided MFRP)

A typical datalayer method can be developed as below: class AccountDataClass { SQLConnection objCon=null; SQLCommand objcmd=null; SQLDataReader objReader=null;

public int Login_Authenticate(SqlParameter[] objParam) { try

LENAPRASANNA MANI, 346238

{ using(SqlConnection loginConnection=GetConnection()) { ... ...//statements } } catch(Exception e) { throw e; } finally { if (objCon.State == ConnectionState.Open) { objCon.Close(); objCon.Dispose(); } } } o Naming conventions: o Table tblTableName. Example: tblTrainDetails o View vwTableName. Example: vwTrainDetails o Procedures procProcedureName or uspProcedureName (usp user stored procedure) Example: uspGetTrainDetails or procGetTrainDetails o Drop down list ddlListName Example:ddlCategory LENAPRASANNA MANI, 346238

Checkbox chkName Example:chkCategory

LENAPRASANNA MANI, 346238

You might also like