You are on page 1of 6

Indexers

------------
Indexers enable objects to be indexed in a similar manner to arrays.
A get accessor returns a value. A set accessor assigns a value.
The this keyword is used to define the indexers.
The value keyword is used to define the value being assigned by the set indexer.
Indexers do not have to be indexed by an integer value; it is up to you how to d
efine the specific look-up mechanism.
Indexers can be overloaded.
Indexers can have more than one formal parameter, for example, when accessing a
two-dimensional array.
LINQ
---------
LINQ provides a simple set of standard operators to query in-memory collections
as well as entities. LINQ for SQL allows us to create DAL s quickly but more impor
tantly they are more flexible and robust than the common approach.
LINQ to SQL provides a runtime infrastructure for managing relational data as ob
jects without losing the ability to query. Your application is free to manipulat
e the objects while LINQ to SQL stays in the background tracking your changes au
tomatically. (119 printed pages)
The DataContext object is in charge of converting rows to objects and vice versa
when interacting with our conceptual model, a DataContext object takes a connec
tion string
Next we will look at how we query related entities and look at the SQL generated
by the DataContext to enable these queries. Because we defined the relationship
s between our entities using EntityRef<TEntity>, and EntitySet<TEntity>
Lambada Expressions
---------------------
A lambda expression is an anonymous function that can contain expressions and st
atements, and can be used to create delegates or expression tree types.
Lambdas are used in method-based LINQ queries as arguments to standard query ope
rator methods such as Where.
a lambda expression typically takes the following structure: parameters => expre
ssion.
Extension Methods
--------------------
Extension methods provide a simple mechanism to extend types in the system (valu
e, reference, and interface types) with new methods. These methods extend the or
iginal type and can be called like regular, defined instance methods, but they l
eave the original type and its methods untouched. Extension methods create the i
llusion that they are defined on a real type, but, in reality, no changes are ma
de to the original types.
Trace and Debugging
----------------------
Trace is actually the process of collecting information about the program's exec
ution
Debugging is the process of finding and fixing errors in our program.
Encapsulation:
----------------------
Encapsualation is basically, wrapping up of data memebers and methods.
As you said, You hide the data for security such as making the variables as priv
ate, and expose the property to access the private data which would be public. S
o, when you access the property you can validate the data and set it.
Abstraction:-
------------------
Abstraction have the methods which will be common for all the derived class woul
d need. It contains the skeletion which needs to be implemented by the derived c
lass also, which will be declared as abstract method.
Finalize and Dispose Method
---------------------------------
Can we use both Finalized and disposed method together ? If yes then who would b
e called first?
Dispose() is called by the user of an object to indicate that he is finished wit
h it, enabling that object to release any unmanaged resources it holds. Use IDis
posable to implement it.
Finalize() is called by the run-time to allow an object which has not had Dispos
e() called on it to do the same. However dispose() operates determinalistically,
whereas there is no guarantee that Finalize() will be called immediately when a
n object goes out of scope as it is called by runtime environment itself.
So dispose will be called first and finalize in end by run-time.

Sn.exe is a tool to create a strong name for a dll, what is the difference betwe
en dll with strong name and dll without strong name?
--------------------------------------------------------------------------------
---------------------------------------------------------
Strong name assemblies are used to overcome dll conflicts. It is a simple text n
ame along with version number, culture information (if provided), plus a public
key and a digital signature. It is generated from an assembly file (the file tha
t contains the assembly manifest, which in turn contains the names and hashes of
all the files that make up the assembly), using the corresponding private key.
Obviosuly assembly without strong name will lack these properties.

Dot Net provide two types of mechanism for serialization, one is xmlserializer a
nd other one is soapformatter/ binary formatter.xmlserializer for webservice and
soapformatter/ binary formatter for remoting . If xmlserializer is used for web
service then what is the role of SOAP in webservice?
SOAP is a protocol used for data exchange b/w webservice and application while X
ML serialiser class is used to encode webservices messages.

Difference between callback and postback?


---------------------------------------------
Callback is a technique to send a request to server from the client script. In c
allback a client function sends a request and a special marked method is invoked
on the server, same method returns the value to another client function to furt
her process the result. Inshort page does not go through full life cycle. A page
has to implement ICallbackEventHandler & implement functions RaiseCallBackEvent
& GetCallBackResult to have callbacks.
Postback is the event which sends the form data to the server. The server proces
ses the data & sends it back to the browser. The page goes through its full life
cycle & is rendered on the browser.
Use Case Diagram
-------------------
The Use case diagram is used to identify the primary elements and processes that
form the system. The primary elements are termed as "actors" and the processes
are called "use cases." The Use case diagram shows which actors interact with ea
ch use case.
Activity Diagram
-------------------
In its basic form, an activity diagram is a simple and intuitive illustration of
what happens in a workflow, what activities can be done in parallel, and whethe
r there are alternative paths through the workflow.
Sequence diagram
---------------------
Sequence diagrams can be used to explore the logic of a complex operation, funct
ion, or procedure. They are called sequence diagrams because sequential nature i
s shown via ordering of
messages. First message starts at the top and the last message ends at bottom. T
he important aspect of a sequence diagram is that it is time-ordered. This means
that the exact sequence of the interactions between the objects is represented
step by step. Different objects in the sequence diagram interact with each other
by passing "messages".
Class diagram:
----------------
From the use case diagram, we can now go to detail design of system, for which t
he primary step is class diagram. The best way to identify classes is to conside
r all "NOUNS" in use cases as
classes, "VERBS" as methods of classes, relation between actors can then be used
to define relation between classes. The relationship or association between the
classes can be either an "isa" or "has-a" relationship which can easily be iden
tified from use cases.
SCRUM
--------------
Scrum is an iterative incremental framework for managing complex work

Scrum is a process skeleton, which contains sets of practices and predefined roles
. The main roles in Scrum are:
the Scrum Master , who maintains the processes (typically in lieu of a project mana
ger)
the Product Owner , who represents the stakeholders
the Team , a cross-functional group of about 7 people who do the actual analysis, d
esign, implementation, testing, etc.
During each sprint , typically a two to four week period (with the length being dec
ided by the team), the team creates a potentially shippable product increment (f
or example, working and tested software). The set of features that go into a spr
int come from the product backlog, which is a prioritized set of high level requir
ements of work to be done. Which backlog items go into the sprint is determined
during the sprint planning meeting. During this meeting, the Product Owner infor
ms the team of the items in the product backlog that he or she wants completed.
The team then determines how much of this they can commit to complete during the
next sprint.[1] During a sprint, no one is allowed to change the sprint backlog
, which means that the requirements are frozen for that sprint. After a sprint i
s completed, the team demonstrates the use of the software.
AGILE
---------
Agile methods are a family of development processes, not a single approach to so
ftware development.
Agile methods break tasks into small increments with minimal planning, and do no
t directly involve long-term planning. Iterations are short time frames ("timebo
xes") that typically last from one to four weeks. Each iteration involves a team
working through a full software development cycle including planning, requireme
nts analysis, design, coding, unit testing, and acceptance testing when a workin
g product is demonstrated to stakeholders. This helps minimize overall risk
ONE WAY BINDING
-----------------
OneWay binding causes changes to the source property to automatically update the
target property, but changes to the target property are not propagated back to
the source property. This type of binding is appropriate if the control being bo
und is implicitly read-only.
TWO WAY BINDING
-----------------
TwoWay binding causes changes to either the source property or the target proper
ty to automatically update the other. This type of binding is appropriate for ed
itable forms
ONE TIME
------------------
Source to Target only when binding creates
Grid -- a table used for positioning objects
Canvas -- used for absoulte positioning
Stack -- used to position objects next to one another

WPF v/s WinForms


-----------------
Databinding in WPF is superior to what Windows Forms offers.
UI and C# business logic can be cleanly separated in WPF
Storyboard
Data/control templates a much cleaner way than anything Windows Forms can offer.
Styles cool and simple. Its so easy to style all your buttons in an application
to have the same look and feel.
Even if the VS designer breaks, its easy to code XAML.
UI virtualization I ve got grids with 100K rows, ticking off a moving market. Per
formance would be dreadful if it wasn t for UI visualization which come for free.
3D support.
Nothing scientific but, UI development feels quicker in WPF maybe its just becau
se a WPF application looks cooler at the end of an iteration, or maybe its becau
se development really is quicker.
I can add a User Experience engineer to my team, and with no C# knowledge he can
work magic in Expression Blend and give the front-office trading application a
makeover that is guaranteed to win over the business users.
Interface
A class may inherit several interfaces.
An interface cannot provide any code, just the signature.
An interface cannot have access modifiers for the subs, functions, properties et
c everything is assumed as public
Interfaces are used to define the peripheral abilities of a class. In other word
s both Human and Vehicle can inherit from a IMovable interface.
If various implementations only share method signatures then it is better to use
Interfaces.
Requires more time to find the actual method in the corresponding classes.
If we add a new method to an Interface then we have to track down all the implem
entations of the interface and define implementation for the new method.
No fields can be defined in interfaces
Abstract class
A class may inherit only one abstract class.
An abstract class can provide complete, default code and/or just the details tha
t have to be overridden.
An abstract class can contain access modifiers for the subs, functions, properti
es
An abstract class defines the core identity of a class and there it is used for
objects of the same type.
If various implementations are of the same kind and use common behaviour or stat
us then abstract class is better to use.
Fast
If we add a new method to an abstract class then we have the option of providing
default implementation and therefore all the existing code might work properly.
An abstract class can have fields and constrants defined
MVP
Model-view-presenter (MVP) is a user interface design pattern engineered to faci
litate automated unit testing and improve the separation of concerns in presenta
tion logic.
The model is an interface defining the data to be displayed or otherwise acted u
pon in the user interface.
The view is an interface that displays data (the model) and routes user commands
(events) to the presenter to act upon that data.
The presenter acts upon the model and the view. It retrieves data from repositor
ies (the model), persists it, and formats it for display in the view.

Model
Represents the data
The entity
Not required to know where it gets its data from
* From a WCF service. WCF RIA Services, etc
May contain validation
View
The screen, the UI, the UserControl in Silverlight
Handles UI look and feel
Presentation of information
Communicates with ViewModel through bindings
ViewModel
Main source of logic for the MVVM triad
Connects the Model to the View
Abstracts the View
Public properties that are bound to a View
INotifyPropertyChanged and INotifyCollectionChanged talk to the View through
bindings
Listens for changes from the View through bindings
Invokes services to communicate outside the MVVM triad

The Model View View-Model (MVVM) pattern attempts to provide separation of the U
I from the logic and data being presented by the UI. This separation allows for
better unit testing and a better separation of concerns

PRISM
Prism is designed to help you more easily build modular Windows Presentation Fou
ndation (WPF) and Silverlight client applications. These types of applications t
ypically feature multiple screens, rich, flexible user interaction and data visu
alization, and role-determined behavior. They are "built to last" and "built for
change." This means that the application's expected lifetime is measured in yea
rs and that it will change in response to new, unforeseen requirement
Basically it is similar like the old "C" age function pointer, where functions c
an be assigned like a variable and called in the run time based on dynamic condi
tions. C# delegate is the smarter version of function pointer which helps softwa
re architects a lot, specially while utilizing design patterns.
Delegates
At first, a delegate is defined with a specific signature (return type, paramete
r type and order etc). To invoke a delegate object, one or more methods are requ
ired with the EXACT same signature. A delegate object is first created similar l
ike a class object created. The delegate object will basically hold a reference
of a function. The function will then can be called via the delegate object.

You might also like