1katoda / SerialReader1

Java serial read
GNU Lesser General Public License v2.1
0 stars 0 forks source link

pregled kode #9

Open sysmat opened 6 years ago

sysmat commented 6 years ago

opazke

tole bolj kot psevdo koda:

public void startMyThread() throws InterruptedException {
        Object requiredObject = new Object(); //Map/List/OwnClass
        Thread myThread = new Thread(new MyRunnable(requiredObject), "SimpleReadThreadApp");
        myThread.start();    

        System.out.println("doing");    
    }

class MyRunnable implements Runnable{

        private final Object requiredInput;

        public MyRunnable(Object requiredObject) {
            this.requiredInput = requiredObject;
        }

        @Override
        public void run() {
            // do staff with requiredInput

            // do business logic

        }
} 

Zaključek

Drugače zanimivo, da si se tega lotil, ampak konceptualno mi je čudno zasnovano

Kako bi jaz zasnoval

GUI program je osnovni: