Hi Dw

I've created the system which will be allowing the user to perform the withdrawal transaction from a self service device so far I've created the side which will be inter reacting with the user which is prompting a user to insert the identification and key in the pin then get to the main menu where by if the user has funds on his account the screen will prompt him to enter the amount he want to withdraw not exceeding the CurrentBal so now what I want now is to create the interface not the UI but the interface that will send the withdrawal commands to the physical cash dispenser, I've tried using the jpos but it produced lots of errors then on my research I came across this simulating article which when I tried it out it resolved the errors that I had and it runs but since it the simulation I don't think it will send these commands so I found that in order to send these type of commands I have to use an interface which I tried it while following the approach of this article http://staff.science.uva.nl/~fdevries/java/java1112/voorbeeldcode/dd.examples.8e/examples/ch13/CashDispenser.java but there were some errors if I put the public void method so I don't know if there can be anyone who can help me in solving this problem. Thank you

Recommended Answers

All 9 Replies

  1. what kind of interface? gui? interface type? ...
  2. what has your question got to do with interfaces?
  3. "there were some errors" ... waaaaay to vague, please be more precise.

Well I've done some research an what I found out was that in order to communicate with the peripheral devices you need to create an interface not the UI or GUI but it more like a class but it start like this public interface CashDispenser{. What I want is to should I say control or manage this peripheral device so that it when the CashDispenser.dispenseCash(amount); method fires it will then start dispensing the requested notes or amount, if you can just look at the like the class start with public class CashDispenser but the interface start like this public interface CashDispenser so now if I do this these codes will be marked as errors: private final static int INITIAL_COUNT = 500
Private int count
Public CashDispenser()
count = INITIAL_COUNT

Saying modifier private not allowed here and also identifier expected and in some other code it says cannot assign a value to final variable count and on these { it says interface method can not have body

Sorry for not formatting the codes I'm using a mobile phone and the format tools is not visible

Any help?

@James thank you but I think the interface that is on that link is the UI, my question is let me put this way I want to direcly comunicate with the Dispenser device so that the device will dispence the required bills.

Thank you

Obviously you didn't bother to try reading the link I gave you, as it does not mention UI at all. It does however start to explain what a Java interface is, why you got the errors you posted in your first post, and the right way to go to prevent them.

@James thanks, I did look at it before and I read from the start to the bottom of that article this is what made me said it like the article is talking about User Interface (UI) "Methods form the
object's interface with the outside world; the
buttons on the front of your television set, for
example, are the interface between you and the
electrical wiring on the other side of its plastic
casing. You press the "power" button to turn the
television on and off." But then today I just reread it and looked it closer I think I get what is meant it just that the example is confusing but I think I get how I will go about this interface, will update this thread about the outcomes if it do work or not, thank you again.

Do some researches on UI components, you will know how the methods and properties the controls have. Eventually, you will get to understand how this UI was made.

@James thank you so much for your link I've done it and well I just found out that actually I didn't need the interface to dispense after I read that this 'public void dispenseCash (Money amount)' is what will dispense cash to the client ie it will take out the required bills to the user.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.