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 implementCalcularVelocidadMaxima(). - Subtypes
Boeing747,Avioneta,PlaneadorandF19, which issealed. Flota(the fleet) implementsIEnumerable<Avion>, so you can loop over it without touching the internal list, andICloneablefor deep copies.- Sorting through
IComparable<Avion>, plus batch operations using adelegate.
## Excerpt
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 */ }
}