I know very little about interfaces, but I have a problem it might be able to fix.
I have a app that deals with tourism reviews such as resorts / hotels / tourism sections (watersports)
In my BLL / DAL I have a couple of list methods, which return specific List Of Objects depending on if it is a resort or a hotel and a detailed review which is the same thing. The classes / objects are different.
The rest of the BLL methods are the same
CountReviews() as Uint16
SetReviewActive() as boolean
etc etc
If I create a DAL interfaces and use this in the BLL, do I just do some kind of object selection in the BLL and call the methods - I can userstand that just about :-)
How do I access the specific methods that exist in the Interface classes that dont implement a interface referance as they return none equal objects
Dim ReviewsCount = (CType(DALObject, Interface).CountReviews()
But them how do I access the specific methods that only exist in one of the classes Like
Function AddReview(Hotel as HotelReviewObject) as boolean
because this does notimplemtnet any referance to the interface, so I dont see how I can get to it enless I create two objects then it defeats the point of interfaces or I create two classes one for Interface and one for non standard methods
greecemonkey
Member
199 Points
306 Posts
BLL > DAL Interfaces
Jan 28, 2013 09:47 PM|LINK
Hello Fourm,
I know very little about interfaces, but I have a problem it might be able to fix.
I have a app that deals with tourism reviews such as resorts / hotels / tourism sections (watersports)
In my BLL / DAL I have a couple of list methods, which return specific List Of Objects depending on if it is a resort or a hotel and a detailed review which is the same thing. The classes / objects are different.
The rest of the BLL methods are the same
CountReviews() as Uint16
SetReviewActive() as boolean
etc etc
If I create a DAL interfaces and use this in the BLL, do I just do some kind of object selection in the BLL and call the methods - I can userstand that just about :-)
How do I access the specific methods that exist in the Interface classes that dont implement a interface referance as they return none equal objects
Dim ReviewsCount = (CType(DALObject, Interface).CountReviews()
But them how do I access the specific methods that only exist in one of the classes Like
Function AddReview(Hotel as HotelReviewObject) as boolean
because this does notimplemtnet any referance to the interface, so I dont see how I can get to it enless I create two objects then it defeats the point of interfaces or I create two classes one for Interface and one for non standard methods
Any comments would be great :-)
Go2Greece Ltd
Angie xu - M...
All-Star
18655 Points
1590 Posts
Microsoft
Re: BLL > DAL Interfaces
Feb 05, 2013 05:56 AM|LINK
Hi greecemonkey
I think you could learn relevant topics below to learn and use the interface, it will be good reference for you,
Interface Definition
Implements Keyword and Implements Statement
Interface Implementation Examples in Visual Basic
When to Use Interfaces
How to: Create and Implement Interfaces
Creating and Implementing Interfaces
For reference- http://msdn.microsoft.com/en-us/library/s3et34z3(v=vs.90).aspx (left side)
hope it helps you,
Kind regards
Feedback to us
Develop and promote your apps in Windows Store