Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mam klasę:
- class FlashCard(val langFromTo: (String,String), val question: String, val answer: String)
- // np. FlashCard( ("POL", "ENG"), "zielony", "green")
- class StackIndetifier(val name: String)
- oraz interface:
- trait FlashCardsDBConnector {
- def addCard(card: FlashCard, stack: StackIndetifier)
- def removeCard(card: FlashCard, stack: StackIndetifier)
- def swapCard(from: FlashCard, to: FlashCard, stack: StackIndetifier)
- def getCardsFromStack(stack: StackIndetifier)
- }
- class CardsStack(val name: String, val cards: Array[FlashCard], DBConnector: FlashCardsDBConnector) {
- def addCard(card: FlashCard)
- def removeCard(card: FlashCard)
- def swapCard(from: FlashCard)
- def getAll()
- def getAllSchuffled()
- def getNext()
- def getRandom()
- }
- Chcę, żeby ten play obsługiwał mi Tak jakby kupkę "fiszek". Pytanko jest, czy ja mam ten interfejs implementować bezpośrednio obsługując wywołania SQL ? Czy robić jakąś pośredniczącą klasę, czy to nie ma sensu ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement