Accessible here: https://white-pebble-0279cb103.azurestaticapps.net/
Walk through the solution you have arrived at, of interest, will be any challenges you faced and what lessons you may have learned along the way.
As an airplane parking assistant, So that I can efficiently manage parking slots, I want to be recommended a parking slot when a new airplane arrives. And to be able to book the plane into that parking slot.
A plane may be parked for a few hours or a few days. There are 100 slots, but they are not of the same size,
- 25 for Jumbos (A380, B747)
- 50 for Jets (A330, B777)
- 25 for Props (E195)
Only the plane types listed above will arrive at the airport Smaller planes can park in larger slots, but not the other way around. If no slot is available, an obvious alert should be raised. We have yet to select the device or the data storage mechanism that will be used. Consider how airlines might pre-book slots in a future iteration of this product.
C# and dotnet 5. I am most familiar with, and is multi-platform and very fast. Blazor because I am familiar with it and enjoy learning it. Blazor Static Web App so I can standup a prototype very fast, and with no cost. WebAssembly versus client server makes no difference to Blazor, so it can use a full data store later by moving it to the Server with minor code changes. Will be able to run on any platform, and a lot of devices with dotnet 6 without a browser.
A drop down with the 5 plane types in them. A "Recommend location" button A "Park aircraft at recommendation" button. Feedback to the user about the recommendation and when it has been parked An "Error" display section.
100 slots available across 3 different types ParkingAssistant class. Park(Aircraft aircraftToPark, ParkingTime timeToParkFor) method (Use an object as we don't know what we need to store, easily extendable)
Aircraft should choose the smallest spot they can fit in that is free.
We should have a class for each type, that owns the spots and controls how many are filled. bool JumboParker(Aircraft aircraftToPark, ParkingTime timeToParkFor) { If can fit, then park else return false; }
Have an ordered list of "parkingAttendants" that are progressed through one at a time until the plane is recommended.
Implement front end first. Not tested for now due to time limits.
Consider how airlines might pre-book slots in a future iteration of this product.
We would need to have the parking slots being time sensitive. At present we have no concept of time.
We also need to consider what if a plane is parked while the attendant is deciding.
Separate the ViewModel from the back end. Streamline the parking recommender code into a base class, as repetitive Fill out the Unit Tests - focussing on edge cases. Add bUnit style Blazor component tests Add Mutation testing checks in pipeline Make sure Domain Language is clear spot vs slot vs parking space
- How much to optimise from the start.
- Differences between the Model and type of the aircraft. Mixed them up
- Building a good looking UI with Blazor is very fast.
- Clean code is great, but can lead you to over abstract
- Your code is "never finished"
- Injecting IEnumerables via DI container is very simple, and adheres to the order of registration.