17 March 2019

c#basics user-defined-exceptions event-viewer unit-test TDD

toop

We learned about User-Defined-Exceptions in .NET and practiced exceptions of this type. we explored the dilemma of who should handle the exception? in our restaurant project.  next topic was testing framework. what is Test framework? why do we need it? what is Test Driven Development (TDD)? . after the discussion, we created our first Unit-Test project of a calculator, and expanded it to test our UniqueListClass

tdd_cycle

More topics covered:

    • Custom Exception ctors (+ auto generated)
    • Exception serialization requirement
    • Event viewer – how to find .NET exceptions?
    • Test importance to maintenance
    • TDD importance to development – time saver
    • Test attributes: [TestClass] [TestMethod]
    • Test exception: [ExpectedException( typeof(…) )]
    • Assert command

Links:

13 March 2019

c#basics exception try-catch-finally throw exceptions-settings

toop

We learned about Exceptions in .NET and the SystemException vs ApplicationException. we practiced the try-catch-finally block. we learned how to stop the program in debugger using the Exceptions-Settings. we learned the benefit of the StackTrace. and finally we used throw to initiate exceptions our selves

ex

More topics covered:

    • message field usage in self thrown exceptions
    • DivideByZeroException
    • Exceptions in arrays – IndexOutOfRangeException
    • Creating Exception object – new ExceptionClassName
    • Inner exception

Links:

10 March 2019

c#basics class-T Indexer IEnumerable-T

toop

We learned about Indexers and the different types of usages. we explored creation of Generic classes using T and implementing indexer, ctor, methods, properties, ToString using type T. we saw how to make foreach available for our class using IEnumerable<T>

Generic

More topics covered:

    • Indexer methods – returning different types
    • T constrains – interface implementations, default ctor()
    • Making types out of Class<T>
    • IEnumerbale – implementation using List.GetEnumerator()

Links:

06 March 2019

c#basics Dictionary Hashmap hashcode Keyvaluepair

toop

We learned about Dictionary and Hashmaps and the hash algorithm usage to store and retrieve data. we used int, string and object types for both keys and values and explored the Dictionary API

hashm

More topics covered:

    • Hash collision
    • Object Hash code as key
    • Dictionary.TryGetValue
    • Dictionary[ key ]
    • Dictionary.Add
    • Dictionary.ContainsKey
    • foreach (KeyValuePair<type, type> item in dictionaryName) …
    • Disadvantage of using object as a key

Links:

03 March 2019

c#basics ArrayList boxing unboxing stack heap List

toop

We learned about ArrayList and the process of boxing-unboxing. we explored memory type Stack vs Heap and how .NET calls the functions using stack-frame. We saw Generic List<T> class which avoids the boxing-unboxing operations. We got familiar with the LINQ API. finally we implemented a Stack data-type functions using List commands (behind the scenes)

stack.png

More topics covered:

    • Garbage Collector (GC) – memory cleaning
    • Recursion methods – StackOverflow issues
    • Stack frame local variables
    • Typesafe
    • List<T>.Insert
    • List<T>.Count
    • List<T>.RemoveAt
    • List<T>.Clear
    • List implementation uses an Array

Links:

27 Feb 2019

c#basics operator-overloading equals dotPeek

toop

We learned about operator overloading. we used dotPeek to investigate c# “under the hood” code. we saw operator == requires also != and also Equals

operator-overloading-5-638

More topics covered:

    • Object class methods
    • operatos overloading: >= <= * /
    • mscorlib.dll
    • Object.RefernceEquals

Links:

24 Feb 2019

c#basics serialization deserialization xmlserializer stream file-stream using xmlattributes

toop

We learned about the serialization and deserialization process. we used the XML format. we wrote to a file using file-stream and XmlSerializer

ser

More topics covered:

    • Stream
    • FileStream class
    • serialization of an array
    • access modifiers required for serialization
    • XML attributes for customizing the serialization
    • c# using() { … }
    • add link to a project

Links:

20 Feb 2019

c#basics interfaces IComparable IComparer sort casting

toop

We learned about array sorting using IComparable and IComparer. we implemented the Generics form of the interfaces IComparable IComparer. we also performed casting using (type)obj.

compvscomp

More topics covered:

    • default value of an object inside a class is null
    • as + null check is better than is + casting
    • IComparer class could be in the same class file
    • reverse sort order

Links:

17 Feb 2019

c#basics properties interface as-is-null

toop

We learned about properties in C#. in the second part of the class we learned about interfaces in C#. we investigated objects using:  is, as, null  key-words

invsab

More topics covered:

    • static class and static ctor
    • properties access modifiers, backing field, abstraction
    • marker interface
    • interface inheritance
    • interface default access modifiers
    • is, as
    • null

Links:

Design a site like this with WordPress.com
Get started