I have come up with a few ideas about abstraction of code and layering in .NET. I would say that my programming ability has finally matured to a professional level.
Software Layers
- User (external)
- User Interface
- Business Objects
- Data Abstraction/Access Layer (DAL)
- Data Cache (OPTIONAL)
- Data/Metadata (external to the application)
Understandings:
· Every layer only has access to the layer below that.
· A change at the lowest layer affects every layer above it.
· UI changes do not require rebuild. When you have this abstraction of layers and you are removing the data access from the UI (User Interface), you can literally drop any UI on the top and it will function just the same once hooked in to the objects.
· You build all of your business rules into the objects. This is where you also do most of the error handling. This way you are throwing back exceptions when objects' properties do not receive the right input when setting them.
· Most of the objects you will build will correspond to a database table on the back end (or a concatenation of tables).
· A data cache is an XML file (or several XML files) that is/are secure. They are stored in a folder somewhere inside of the application, or somewhere else that can be accessed when the database is unreachable. Caching also helps speed up the data access process.