26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Get<br />

Return pdblLogTime<br />

End Get<br />

Set(ByVal Value As Double)<br />

pdblLogTime = Value<br />

End Set<br />

End Property<br />

Public Sub Update()<br />

' do the logging activity here<br />

End Sub<br />

End Class<br />

In short the customer class is doing lot of activity. There is lot of tangling of code. So<br />

how do we overcome this problem… Simple separate the System level concern (Audit<br />

Trail) from the core level concern ( Customer code check). This is achieved at this<br />

moment in .<strong>NET</strong> using attribute programming.<br />

Here is the change to the customer class<br />

Imports System.Reflection<br />

Public Class ClsCustomer<br />

Private pstrCustcode As String<br />

Private pstrCustName As String<br />

Public Property Code() As String<br />

Get<br />

Return pstrCustcode<br />

End Get<br />

Set(ByVal Value As String)<br />

168

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!