Tagged Questions
0
votes
0answers
42 views
MVC class modeling
I have following requirement and I am trying to design class diagram. This is the first time I am creating class diagram so I would like to get some advice from experts.. :)
This is a simple login ...
0
votes
0answers
66 views
Dynamically add/remove components to/from panel
I'm in a little planning phase of my java/swing project. Here is a picture:
It is a main panel containing several sub panels depending on the selected date in the top center. I want to browse those ...
-1
votes
2answers
192 views
Help with MVC design pattern? [closed]
I am trying to build a java program for user login but I am not sure if my MVC design is accurate. I have the following classes:
LoginControl - servlet
LoginBean - data holder java class with ...
0
votes
0answers
49 views
URL and Controller structure for parent-child-relationship
I use an MVC web framework to create an application which contains a hierarchy:
Location <1-N> Devices <N-M> Services
I have a number of Locations. Each Locations can have several ...
0
votes
0answers
41 views
Specific class to pass a bundle of data from my Model to Controller or a simple Collection?
I am doing an Invoice application implementing MVC pattern design in Java. One of the features my application has to have is showing all info about a Customer: Personal data, Calls, Invoices, ...
0
votes
1answer
175 views
Is it fine to skip MVC?
I am building a pair of components that communicates in a one-way fashion:
[ JButton ] --> data...process...process...out --> [ JTextField ]
The JButton allows the user to select a file and ...
0
votes
1answer
215 views
MVC: How to Implement Linked Views?
I'm developing a java application to visualize time series. I need (at least) three linked views, meaning that interaction with one of them updates the others.
The views are:
A list represents the ...
-1
votes
2answers
142 views
How to fit requirements into MVC
Let's say we have a website requirement to allow User functionality. Simple!
We create the UserModel, UserController and UserView. Works perfectly.
However, let's assume that User has a many-to-one ...
0
votes
1answer
145 views
How to update User interface form through database update
I have a client server application. Assume I work as a Support executive, resolving customer tickets. We(our support team) have got two tickets to work on.
Ticket 1: Client "Liver" raised a ticket ...
0
votes
3answers
287 views
What are the steps to grouping related classes into packages
What are the steps needed to be taken to group related classes into packages in Java?
In my case, I have about a number of .java files that I'd like to group into 3 packages according to the MVC ...
0
votes
1answer
225 views
Implementing separation of concerns via MVC
I'm creating a question to see if my understanding of MVC separation is correct, I haven't been able to find a clear answer anywhere online. So is this the right way to implement it (in Java):
I ...
4
votes
2answers
688 views
Managing threads in Java with a good pattern
This morning I began writing a minimal chat using Java socket and threads but it took some minutes for me to experience a lot of problems in the MVC management.
Currently I have 3 classes:
Main, ...
1
vote
1answer
3k views
Java desktop application using MVC + Hibernate
I'm developing a Java desktop application. I'm planning to use MVC architecture described at Oracle site: Java SE Application Design With MVC.
I need to store data in database so I decide to use ...
1
vote
1answer
142 views
how to model a connection to a resource, with rudimentary event processing
For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast:
Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the ...
4
votes
2answers
753 views
How does MVC work with the principle “Tell, Don't ask”?
Procedural code gets information then makes decisions. Object-oriented
code tells objects to do things.
— Alec Sharp
So, when a view wants to display some information that is suppose to be ...
4
votes
1answer
405 views
Should I use JavaFx properties? [closed]
I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code ...
-1
votes
2answers
134 views
Java generalization
I have a question regarding generalization. I know when it is needed to be done, but is it worth having an extra class for 1 field?
e.g.:
StatisticsCustomer has fields: Customer customer and int ...
1
vote
1answer
253 views
Creating a System Sequence Diagram from an [extended] use case
As I have been taught - one controller = one use case.
But I have:
OutsiderController
SupplierController (which extends OutsiderController)
SubContractorController (which also extentds ...
2
votes
1answer
291 views
Do I need JUnit tests for the controller layer on a MVC when I have a database layer
I have a MVC which has this structure:
ui
controller
db
model
Basically the controller doesn't really do much more than connection ui with db layer.
Do I need to provide JUnit tests for the ...
0
votes
1answer
184 views
Where should I put my method
I am writing a Java program using the MVC design pattern.
I have classes Item and Supplier. In the database they are connected through a item_supplier table.
I'm writing a method which will give me ...
1
vote
2answers
537 views
MVC pattern with JSF-Spring-MyBatis webapp
I've a Java webapp with these frameworks and I want to know if my implementation meets with MVC pattern:
Controller Layer (V)
I'm using JSF
@ManagedBean
public class Controller{
...
2
votes
1answer
95 views
Java MVC extra classes
I have a simple MVC project. My current packages:
gui
controller
db
domain
I want to put extra classes which I will use, e.g. md5 hashing, email validator (methods which I will use in more than ...
3
votes
2answers
556 views
MVC framework that uses classes instead of methods for actions
In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of ...
0
votes
1answer
132 views
Controller JSP - no view
Most people say do not use JSPs. But what if I have a JSP that does not show anything, it only acts as a controller? Why would I do that? Because we do not need to redeploy complete webapp to make a ...
0
votes
1answer
883 views
How to design an application that read files using MVC pattern?
I am going to write an application that reads data from a csv file, and display that data to the user. I intend to apply an MVC design pattern to create this application. A user will interact with ...
3
votes
1answer
809 views
Is MVC the optimal pattern to build a RESTful web service?
Not being a Java practitioner, I recently came to learn about the JAX-RS specification and Apache CXF framework. While still wrapping my head around all these things, I also read the this question on ...
2
votes
2answers
221 views
What should be in my model and what should be in my controler?
We are writing a system with a sort of quasi-MVC structure (it was never stated as that, but that's what it is). I'm building up a full knowledge of the system and the controller will have to make ...
0
votes
2answers
263 views
Communication between View and Model
I have a basic issue with the MVC architecture. I am aware that the View usually listens to the Model. But how are user requests propagated to the Model?
Currently I do it like this, when the user ...
5
votes
2answers
221 views
method to allow me ability to freely modify my classes, but make them immutable to others?
I am creating the model part of an MVC architecture. My one class will provide all the accesses to allow one to fetch system state. I want most of this state to be immutable as it shouldn't be ...
0
votes
1answer
695 views
Problems for Sample Code [closed]
I was recently asked to write some sample code that solves a difficult technical problem. I've been mulling over what kinds of problems might be good to solve in code to demonstrate my skills in such ...
2
votes
2answers
781 views
How to use MVC in practice
I'm very confused. I can't even begin to understand how MVC would be implemented outside of web development. This might seem like too general a question, but how would one apply MVC. I have the ...
2
votes
2answers
2k views
How to synchronize client and server model objects?
We have a client-server application with a thick client (GWT).
There are client-side MVP presenters (MVC controllers) which hold references to some objects viewed in the GUI. Some user actions cause ...
1
vote
1answer
1k views
Handling error message for a Spring MVC login form
This can apply to many error handling scenarios, but I'm curious about how to do it in a login scenario.
Given this Spring controller method:
@RequestMapping(value = "/account/login", method = ...
4
votes
2answers
255 views
MVC - Isolating view and model logic
I understand that the model should generally consist of data manipulation and the view for data display from the model, but how do I keep my model and view layers decoupled?
My simple view has a few ...
2
votes
1answer
483 views
MVC - sharing multiple models
I am building a java desktop application where I am attempting to implement MVC. The GUI interface has multiple views (think pop-up windows) from the main view. Each view has its associated model that ...
7
votes
4answers
4k views
Using MVC in a Java app
I need to write a cross-platform GUI application to process (in multiple threads) and visualize fairly large quantities of data. Ideally the application should be relatively fast and look good.
The ...
0
votes
2answers
127 views
How to handle notifications to several partial views of the same model?
I am working on refactoring an old simulation of a Turing machine.
The application uses a class that contains the state and the logic of program execution, and several panels to display the tape ...
1
vote
3answers
7k views
In MVC , DAO should be called from Controller or Model
I have seen various arguments against the DAO being called from the Controller class directly and also the DAO from the Model class.Infact I personally feel that if we are following the MVC pattern , ...
2
votes
2answers
641 views
MVC: View-Controller Interaction
I have a Java application that I am implementing following the MVC pattern.
I want to have a window (view) that contains a form which allows the user to add several text fields. There will also be a ...
1
vote
1answer
458 views
MVC, Java Design Pratices, and Flaws of java.util.Observable and java.util.Observer
I am planning learning Model-View-Controller (MVC) development using Java. While reading I came across a post which mentions java.util.Observer and java.util.Observable for MVC development.
As I ...
2
votes
1answer
469 views
Package conventions for MVC app [closed]
Which (if either) of the below is the more conventional/acceptable way to structure packages in a J2EE app? I'm trying to follow an MVC pattern as much as possible.
foo.bar.users
...
3
votes
1answer
1k views
Opensource showcase for MVC in Java Swing [closed]
I've allready created small desktop CRUD applications using Java/Swing. In hindsight I'm not quite sure if the overall design of these applications is good. I've also done some reading on MVC and ...
2
votes
1answer
1k views
Difference between Controller and Dispatcher in MVC for web frameworks?
In MVC applied to WSGI or Java EE, is the Servlet a controller, dispatcher, or both? I think I've seen system diagrams where the controller and the dispatcher are different. Could the controller ...
9
votes
2answers
6k views
How to completely decouple Model from View/Controller in Java Swing
Is there a collection of commonly-agreed-upon design guidelines for separating the Model classes from the View/Controller classes in a Java Swing app? I'm not so concerned that the View/Controller ...
13
votes
4answers
3k views
Explain Model View Controller
My experience with developing dynamic websites is limited mostly to Java servlets. I've used Tomcat to develop various Java servlets, and I wouldn't hesitate to say that I'm reasonably proficient ...
4
votes
1answer
303 views
MVC for our application?
There are some issues about how to manage our program designs and programming styles. I was assigned to find a solution to write reusable code - though, the programming team does not follow the rules.
...