t@mickwd:~/projects/cs-net-poo$

projects / cs-net-poo

┌─ Object-oriented programming

cs-net-poo

An airplane fleet manager in C# .NET. It covers inheritance, abstract classes, interfaces, delegates and deep cloning.

## Summary

My second midterm for Object-Oriented Programming. The WinForms UI is kept apart from the business logic, which lives in its own class library (BL), and every class is documented.

## What it shows

  • An abstract base class, Avion (airplane). Every subtype has to implement CalcularVelocidadMaxima().
  • Subtypes Boeing747, Avioneta, Planeador and F19, which is sealed.
  • Flota (the fleet) implements IEnumerable<Avion>, so you can loop over it without touching the internal list, and ICloneable for deep copies.
  • Sorting through IComparable<Avion>, plus batch operations using a delegate.

## Excerpt

BL/Clases.cs
public abstract class Avion : IComparable<Avion>
{
    public abstract int CalcularVelocidadMaxima();
    public int CompareTo(Avion x) { /* ... */ }
}

public sealed class F19 : Avion { /* can't be inherited */ }

public class Flota : IEnumerable<Avion>, ICloneable
{
    public delegate void PonerEnVuelo(bool estado);
    public object Clone() { /* deep copy */ }
}