Object Orientation

Moderators: None (Apply to moderate this forum)
Number of threads: 44
Number of posts: 76

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
OOP begginer organising project Posted by vladakg85 on 12 Jan 2010 at 6:55 AM
Ok, I started a few days ago to learn OOP. Basic concepts I understand but now I want to create a project and use Design Patterns in it, so the first idea was with singleton patterns.
I have 3 tiers GUI-BL-DAL on GUI I have MVC but that is not important now. I want to find the best way to communicate between this tiers so the first idea was:
BL classes: Manager, BookManager, MemberManager, EmployeeManager;
DAL classes: Storage, BookDAL, MemberDAL, EmployeeDAL;

BookManager, MemberManager, EmployeeManager, BookDAL, MemberDAL, EmployeeDAL implement their interfaces IBookManager ... They hold my application functionalities.

Manager and Storage are Singletons which instatiates other classes from their layer so if I want to invoke some DAL method from BL i say:
Storage.GetStorageInstance.BookDAL.SomeMethodFromDAL();

BookDAL is property that return IBookDAL.

But I heard that singletons are bad. So I want to try to change this somehow now I'am trying to do layer communication with Factory pattern but I dont know if this is good.

Can somebody direct me what is the best practices for communication between layers in application? Is my approach good or bad.

One more question where is the best place to keep cached data (from database for example, list of members in a grid ...) is it in BL layer or GUI/Proxy layer?

Thanks
Thread Tree
vladakg85 OOP begginer organising project on 12 Jan 2010 at 6:55 AM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.