Skip to content

Sp4ceFr0g/Advanced-Programming-Techniques-2025

Repository files navigation

📘 Advanced Programming Techniques

My lab work for the course — a mix of experiments, broken stuff I fixed, and the “oh, that’s how it works” moments.


✨ About this repo

Hey — this is my project folder for the Advanced Programming Techniques course. Inside are the labs I completed during the semester. I tried to keep each lab tidy and include notes on what I did and what I learned. This isn’t production code — it’s my learning log. If you read anything that looks messy, that’s probably where I learned the most.


📚 Contents (Labs 1 → 5)

  1. Lab 1 — Getting started & OOP basics
  2. Lab 2 — LINQ
  3. Lab 3 — Databases & EF Core
  4. Lab 4 — Async / Concurrency & Testing
  5. Lab 5 — Final integration / mini-project

Lab 1 — Getting started & OOP basics

This was the warm-up lab. I set up the project, learned the repo / build flow, and practiced fundamentals:

  • Project & environment setup (solution layout, folders, compile/run)
  • Basic OOP practice: classes, constructors, inheritance, and overriding ToString()
  • Small exercises to practice lists, loops, and simple I/O to the console
  • Basic Git usage — init, add, commit, push (yep, I broke commits once and fixed it)

What I learned: how to set up a clean solution structure and why good naming matters. Also learned to commit often.


Lab 2 — LINQ

This lab was a lot of fun — LINQ felt like writing SQL directly in C#. Tasks were done using both query and method syntax.

  • Filter and transform number sets (e.g. select numbers > 80, order descending)
  • Transform numbers into strings like "Have number #n"
  • Work with people & city datasets:
    • Filter by height
    • Shorten names (John Doe → J. Doe)
    • Collect distinct allergies
    • Join people to cities and filter by population
    • Convert a list of people to XML using XElement

Snippet (example):

// method syntax example
var bigNumbers = numbers.Where(n => n > 80).OrderByDescending(n => n);
var transformed = bigNumbers.Select(n => $"Have number #{n}");

Files: Advanced ProgrammingTechniques 2Lab.pdf (lab instructions & my solutions)


Lab 3 — Databases & EF Core

Here I set up EF Core with SQLite and modelled entities and relationships. This was very practical — I finally understood how ORMs map objects to the database.

  • Created Student, Class, and Teacher entity classes
  • Configured a DbContext and worked with migrations
  • Implemented relationships:
    • One-to-one (Class ↔ Teacher)
    • One-to-many (Teacher ↔ Classes)
    • Many-to-many (Students ↔ Classes)
  • Practice CRUD: add, query, remove, and re-query to see how FK constraints show up

Quick commands I used:

Install-Package Microsoft.EntityFrameworkCore.Sqlite
Install-Package Microsoft.EntityFrameworkCore.Tools
Add-Migration InitialCreate
Update-Database

Files: Advanced Programming Techniques Lab3.pdf (lab instructions & my solutions)


Lab 4 — Async / Concurrency & Testing

This lab pushed me into thinking about time: async operations, tasks, and simple thread-safety. I also started (very) basic unit tests.

  • Implemented short async methods using async/await to simulate I/O-bound workflows
  • Explored Task vs threads and learned pitfalls (race conditions, shared state)
  • Wrote a couple of unit tests (xUnit) for key methods to practice TDD basics
  • Added small synchronization where needed (locks / thread-safe collections)

What I learned: async makes code cleaner but debugging async flows requires careful logging. Tests make refactoring safer.


Lab 5 — Final integration / mini-project

The final lab was about bringing things together. I created a small integrated demo that uses LINQ to filter data and EF Core to persist results — plus a tiny console interface to play with the data.

  • Connected previous lab pieces: data models + queries + persistence
  • Implemented a tiny “seed + query” console flow so you can run the program multiple times without duplicating data
  • Polished ToString() on entities so output is readable when printed
  • Added short README notes and run instructions (this file)

What I learned: how small, consistent patterns (seed, save, show) make demos reliable and easy to test.


🛠️ How to run (general)

Most labs are console apps. Here’s a general recipe:

dotnet build
dotnet run --project ./path/to/your/project

If you want to reset the SQLite DB used in Lab 3, delete the DB file (or clear the DbSet entries from code) and re-run migrations:

dotnet ef migrations add 
dotnet ef database update
// or delete the .db file and let EF recreate it if your code seeds data

💬 Final notes (student voice)

This repo is me learning. There are bits that work, bits I broke, and bits I fixed at 2AM while wondering why the foreign key was null. If you’re browsing this, thanks for stopping by — and if anything here helps you, I’m glad I wrote it down.

— a student who learned a lot and still has TODOs in the code 😅

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages