If you can't read please download the document
Bigger Stronger Faster
Embed Size (px)
344 x 292
429 x 357
514 x 422
599 x 487
DESCRIPTION
Things I have learned over the years through experience of having to deliver code rapidly, with few defects and maximum functionality. I cover basic coding techniques, automated testing and sometimes I have enough time to review tools and code generation!
Citation preview
1. Making Quality .NET Applications Fast and Bug Free Chris
Love ProfessionalASPNET.com Twitter.com/ChrisLove
FaceBook.com/ProfessionalASPNet
2. 3. Code Complete*The Art of Unit Testing * Pragmatic
Programmer 4.
Built over 300 ASP.NET sites
Reduced Number of Potential Bugs
Ease to Maintain and Extend
Ability to Adjust on a Dime
5.
Bigger Solid Application Architecture
Faster Confidently Create Code Faster
6.
Build Orthogonal Applications
Dont Repeat Yourself (DRY)
Build a Knowledge Portfolio
7.
Eliminate Effects between Unrelated
8.
protected void btnCalc_Click(object sender, EventArgs e)
// Line after line of business logic
9.
protected void btnCalc_Click(object sender, EventArgs e)
BusinessClass.DoWork(...);
10.
11.
public CustomEntity GetCustomEntity(int CustomEntityID, bool
IsActive)
SqlDatabase sqlDb = new SqlDatabase(siteConnectionString);
DbCommand dbCommand =
sqlDb.GetStoredProcCommand("spGetCustomEntity");
CustomEntity custEntity = new CustomEntity();
sqlDb.AddInParameter(dbCommand, "@CustomEntityID",
DbType.Int32, CustomEntityID);
sqlDb.AddInParameter(dbCommand, "@IsIncident", DbType.Boolean,
IsIncident);
using (IDataReader dr = sqlDb.ExecuteReader(dbCommand))
12.
public ICustomEntity GetCustomEntity(int vCustomEntityId)
CustomEntity lCustomEntity = null;
using (SafeDataReader dr = new SafeDataReader(
ExecuteReader("spGetCustomEntity", CommandType.StoredProcedure,
"@CustomEntityID", vCustomEntityId)))
lCustomEntity =
CustomEntityRepositoryHelper.BindCustomEntity(dr, true, this);
13.
14.
public SqlDataReader ExecuteReader(string sProc, CommandType
ct, SqlParameter[] arParam)
Database database =
DatabaseFactory.CreateDatabase(ConnectionString);
DbCommand storedProcCommand =
database.GetStoredProcCommand(sProc);
foreach (SqlParameter parameter in arParam)
database.AddInParameter(storedProcCommand,
parameter.ParameterName,
parameter.DbType, parameter.Value);
return
(SqlDataReader)database.ExecuteReader(storedProcCommand);
15.
FirstOrDefault(ObjectQuery)
ToDictionary(ObjectQuery)
16.
TEntity ExecuteFirstOrDefault(ObjectQuery objQuery){
return objQuery.FirstOrDefault();
17.
18.
Requires a slightParadigm Shift
Requires More Time Up Front, but Reduces Ultimate Time to
Market
19.
Refactor Coding Methodologies
Small Units of Work that can be independently Tested
20.
Testing a Complete Unit of Work
Typically including Dependencies like Databases and the File
System
A Common Way To Ease into Automated Testing
21.
Automated Tools to Automatically Test Application
22.
LOAD MORE