Class Flashcards
Abstraction in C#
Process of showing only essential information to user
Missing or incomplete implementation
Abstract class
base class cannot be used to create objects only can be accessed from inherited objects cannot be static class cannot have multiple inheritance cannot be inherited from structures
Abstract method
used only in abstract class without body and can be used by derived/inherited class
default access modifier
most restricted acess to that member
class —> internal
Indexer
Instance of a class or struct to be indexed as an array
Arguments to console application
string array object
DDL commands
Create, alter, truncate, drop
DML commands
Insert, update, delete,select
Default constructor parameters
zero. when no constructor defined
Connection pooling
Cache of the connection established so as to reuse when further requests to the database
struct / structure
value type – single variable hold related info/record
Cardianility
Relationship is one to one, one to many or many to many
Inheritance
Allow to define a class in terms or another class from one base class only Object class is the ultimate base class struct does not support inheritance
Restriction to be a Base class
Only time class cannot be used as base class
- sealed
- only private constructors
Polymorphism
Class to have multiple implementations with the same name
Static/Compile time polymorphism –>Early Binding
–>overloading
Dynamic/Runtime polymorphism —>Late Binding
–>overridng
Access base class virtual member
base.A()
shadowing
using 'new' keyword to hide the base class member [method hiding]
nested class
class inside another class to logically group --->encapsulation
encapsulation
data hiding –>mark all variables as private and use public get set method to access data
or hiding the complexity
Garbage collection
The process of releasing memory
root
storage location with the reference to an object in managed heap
clrMD
Diagnostics. Runtime inspect crash dump and attach to live process and perform all sorts of queries against the runtime
MongoDb`
Collection and concepts
Database is a physical container of collections
Database –>Collection of documents/tables
Document–>Row or key value pairs
Hexadecimal
0-9 ABCDEF
Dynamic variable
Change variable type at run time based on assigned value
ExpandoObject
Will let you add objects at runtime
dynamic contact=new ExpandoObject()
statically typed object of expandoobject type
value types are stored in stack and reference type in heap
int inside a class is stored in heap
Objectcache xxx=memoryCache.Default in c#
In MVC controller can have attribute
OutputCache(duration:inseconds)
Objectcache xxx=memoryCache.Default in c#
In MVC controller can have attribute
Default location: webserver,webbrowser, proxyserver)
OutputCache(duration:inseconds)
main method is static
callable without creating an instance of a class
data type
defines the size of memory to store data
javascript – primitive, composite and special datatypes
primitive - string, boolean and number
composite - object array and function
special - undefined and null
control transfer statement
break; continue
control structure, repetitive statements While loop Do while loop for loop for each
control transfer statement break; continue,goto, throw
Continue statement can be used to go to the next iteration without exiting the loop
do while loop executes once before condition reaches
while loop checks the condition before executing
Recursion
Calls the method by itself
Stackoverflowexception
very deep and unbounded recursion
Objects are self contained data structures with events, properties and methods
properities are called smart fields –>data represent
Method —>behavior
events —>communication
constructors
special methods executed when a class is initiated
property has 2 accessors
get and set the value of property
data fields are declared private
Accessed using public properties
Delegates
Encapsulates a method with a special signature
Delegates
Encapsulates a method with a special signature
public delegate void RectangleHandler(Rectangle rect)
namespace
organize code and use unique class names
int, byte, bool, char struct value type
string, class, interface, object, delegate, class are reference types
Assembly
Unit of executable code .exe or dll
Access modifies namespace - default public
class - internal
no access modifiers allowed for namespace
public and internal for class
Abstract method provides a definition, no implementation
Any member of the class is abstract, class itsellf need to be marked as abstract
cast an object any of it base types
Cast to its class types or any of the base class types
is operator to check casting can be done
as operator returns null is casting failed
Icomparable namespace interface
int compareto(Object obj)
Interface
Class that implements interface must implement all methods of the interface
Class can have multiple interfaces can have only one base clas
Class is a template for object creation
Properties are data
Methods behavior
Events communication
Managed code - generated by c# compiler executed by CLR
Unmanaged code compiled to native machine code executed by operating system
Unit Testing – unit of code testing
Integration testing —integration of components testing
(component works with external webservice etc)
System Testing – overall testing of system software
Acceptance testing —>Alpha testing and Beta testing
Regression testing ->make sure nothing is broken with new functionality implementation
Black Box Testing – Input output testing
White Box Testing — unit testing —
Stack data structure – LIFO or FILO
Last in first out
push, pop, peek
heterogenous auto resize
WCF-- Interface IService and class composite type svc similar to asmx(web service)
IService –>OperationContract
CompositeType — >datacontract with datamember
communication mode –>tcp, http, named pipelines msmq and peer to peer
Boxing is the process of converting a value type too reference type
stack to heap
ArrayList can hold all variable types
array list is heterogeneous
Array is homogeneous
Queue is a collection first in first out FIFO
circular array with head index and tail
Queue is heterogeneous- different variable types
Enqueue, dequeue, peek and contains
Docker – container application
Docker Service, Kubernates, Service Fabric to work with multiple services in containers
container application are easy for debugging, deployment and testing
Linked list is a collection of nodes with each node has a link to the next node in the sequence
Deletion and insertion fast and no limit to the size
Sorting –> BubbleSort and QuickSort
Bubblesort —>comparison and swap
Database bottlenecks:
abnormal cpu usage
memory leak — not enough RAM and database started using swap memory
WCF–>endpoint
Address, Binding and Contract
Address: uri
Binding: HttpBinding or wshttpBinding
Contracts: Service, Data and Operation