31 March 2019

DATA-ACCESS-OBJECT SQLITE 1:1 1:many many:many

sql2

We discussed the separation between Graphic User Interface (GUI)Business Logic (BL) and Data Access Layer (DAL) – which includes the Data Access Object (DAO). We explored the table relationship flavors 1:1 , 1:many , many:many. we created two SQLite tables containing 1:1 relationship using Primary Key (PK) and Foreign Key (FK) references. then we wrote a C# program which executes a join query on these two tables, and stored the result in an anonymous object (for a new view)

1_1

More topics covered:

  • Join select query in C#
  • Creation of anonymous object from an SQL result
  • Combining PK + FK between two tables (SQLite)
  • Creating SQLite table with FK null chicken-egg dilemma

Links:

27 March 2019

DATA-ACCESS-OBJECT MSSQL SSMS LINQ POCO

sql2

We solved some SQL queries and talked about different SQL JOIN query flavors. we took a brief look on the SQL Server Management Studio (SSMS) and ran a few queries against the MicroSoft SQL Server (MSSQL) [will be elaborated in our next classes]. We made a Plain Old C# Object (POCO) class and used it to store information which we read from the database (into a List). In other words, we used the Program.cs class to behave as an Access Data Object (ADO) to our data base. then we got familiar with the concept of querying  List<Employee> using Language Integrated Queries (LINQ) using the two formats: query syntax (looks like SQL) and method syntax (using lambda => expression)

linq

More topics covered:

  • POCO constrains
  • Immediate window (Alt + Ctrl + I)
  • SQLITE syntax vs MSSQL syntax
  • LINQ Anonymous objects
  • SSMS query runner

Links:

24 March 2019

DBMS RDBMS SQL NOSQL SQLITE NUGET

sql2

We got familiar with Data Base Management System (DBMS) and the Relational Data Base Management System (RDBMS). we explored what is SQL? and what is its purpose. we talked about the difference between SQL and noSQL databases. we downloaded the SQLite DB Browser and created our first DB using SQL queries. then we wrote a C# program which runs queries against the same SQLite DB, using SQLite nugets

nosql

More topics covered:

  • Advantages of using DBMS
  • Advantages of using RDBMS
  • DB in JSON format   { key : value }
  • DB normalization rules
  • Additional data bases: MySQL, MongoDB, PostgreSQL, etc.
  • noSQL usages
  • C# GetValue command
  • Nugets
  • SQLite nuget package

Links:

 

 

 

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:

Design a site like this with WordPress.com
Get started