llblPowa wrote:
Hello,
Thank you for releasing HdN. It is a great example to learn the way you, experts, decided to architect you system.
HnD . you're welcome
btw - here are question for you:
1) by parsing the code and especially the interaction between the BL and the GUI, I saw that the BL returns (for collection) either DataTable, Dataview or EntityCollection.
Could you explain why and in which case?
In a lot of cases where data was required by the GUI or BL, we needed aggregated data or additional data from related entities. As it was often the case that the data was used in a read-only fashion (just read the data, consume it and use the result further) as a forum is mostly a one-way street, and because of the nature of the sets we needed, we decided it would be more efficient to just pull the fields from the db we needed, instead of full entities with data we didn't need for that particular call. After all, LLBLGen Pro has this feature (dyn./typed lists) especially for this purpose.
IMHO - but I am far for being good - before going through your implementation, I would return only LLBL stuff (EntityCollection, TypedList, TypedView, DynamicList) or .NET stuff (datatable, dataview, dataset) but never both?
I second Walaa's answer, with the addition that the entity collections are also used in scenario's where entities had to be cached, where entities had to be referenced as objects (like in the case with Section entities, see the CacheManager for example). For readonly data, it's often more efficient to just pull the data you need in a flat table and consume it. That doesn't mean you shouldn't use entities in these scenario's. As entity fetch speed is on par with datatable speed these days (unless the entity has very few fields), it doesn't matter much, but it can be you for example need 3 fields from an entity with 10 fields. Then just pulling the 3 fields into memory instead of all 10, for a lot of entities in one set is more efficient. As a forum is a 'read many, write sometimes' kind of application, read-speed is essential.
2) If I guess right, the GUI will exclusively call <Name>GUIHelper and <name>Manager are only called by <Name>GUIHelper?
GUI calls GUIHelper and Manager classes, they never call directly DAL code. GUIHelper classes are for reading data, Manager classes are for manipulating data (delete, insert, update)
PS : While going througth code is good for learning, I think that you should also add a kind of technical docs describing the architecture you put in place and also the reasons behind:-)
We added a lot of comments to the code, and personally I was just too tired to write just a thick releasable (!) design document for explaining everything in detail. it already took too long to get it done, so I decided it would be best to have a developer guide doc which explains everything briefly, and leave the rest to the detailed comments.
You read the developer guide? As your questions are explained in there as well