Hey guys,
I am working on my first layered application right now. I have the 3 standard Layers, Presentation, Business Logic and Data Access. Also I have a Shared Layer, which consists of some Attributes, Helper classes and the like and also my actual Business Objects so they can be used through all Layers.
I am using simple textfiles as database, no SQL Database or the like, and only need to read in and write out full files. My Data Access Layer knows how to map my Business Objects to a file and back. My Business Logic Layer forwards Load/Save functionality by using the Data Access Layer through Interfaces and applies some rules. The Presentation Layer consists of my Forms and uses the Business Logic Layer to get my BOs and populate controls. Does this sound right to you guys?
Also I am not really sure where to put some stuff:
1. The User can access a file from a Local source, or alternatively through a file server. Basically I am downloading the file temporary and then load it into my program. What Layer should that FTP access happen in? Would my BOManager offer SaveLocal/LoadLocal and SaveOnline/LoadOnline methods and use my FTPClient class. Or should I create 2 several Manager classes? Or would FTP access belong into my Data Access Layer? I know I maybe am thinking too much on this, but well, want to learn the right ways as early as possible.
2. There has to be some information around whether the User has already specified a file name and location, so my program can use those Information after the first save. Would I put such stuff into my Business Logic Layer or UI?
3. My BOs hold values which I want to output with different units. For example I have a temperature value. The user will have the option whether he wants to use °F or °C. Internally I always want to store it as Kelvin. Where would I put the Logic to convert those values?
4. I am working with some .ini files to setup my program. Does reading/writing them also count as Data Access? Should I create several classes for managing several different structured .ini files, or just one?
Excuse my bad english and explanation skills please... Hope someone can help me.