locked
BLL > DAL Interfaces RRS feed

  • Question

  • User357616875 posted

    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 :-)

    Monday, January 28, 2013 5:47 PM

Answers

  • User-166373564 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 5, 2013 1:56 AM