Hi, i am new to this forum, and also new to JAVA, at the moment i have an assignment in which i am desperately in need of help.
I don't know much about MVC and i was wondering if there is any one out there that could help me.
regards.
Hi, i am new to this forum, and also new to JAVA, at the moment i have an assignment in which i am desperately in need of help.
I don't know much about MVC and i was wondering if there is any one out there that could help me.
regards.
For — a compact, practical primer tied to the thread so far (given 's prompt and ' book suggestion). This is a hands‑on view of MVC for a Java assignment and a short checklist to implement it cleanly.
Model, View, Controller — what each should do and how they interact:
A simple implementation checklist and minimal example:
PropertyChangeSupport or a small listener interface to notify views.Example model snippet:
public class CounterModel {
private int count;
private PropertyChangeSupport pcs = new PropertyChangeSupport(this);
public void addPropertyChangeListener(PropertyChangeListener l) { pcs.addPropertyChangeListener(l); }
public void increment() { int old = count; count++; pcs.firePropertyChange("count", old, count); }
public int getCount() { return count; }
} Common pitfalls: putting business logic in the view, failing to fire change events, and doing blocking work on the EDT. For general background see Model–view–controller. For Java specifics, the JavaDoc for PropertyChangeSupport and the Oracle Swing concurrency tutorial are practical references.
Jump to Post— peter_budo 2,532Help you with what?
Help you with what?
Try the book 'head first design patterns'. It has a clear layout of the model view controller pattern (which is fairly hard to really grasp in the start, in my opinion).
The book should tell you a bit more though, and there are more pages about design patterns. Give it a whirl :p
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.