model-view-controller

What's the best way to expose Java components such as a JButton in an MVC architecture?

无人久伴 提交于 2019-12-22 09:39:39
问题 I'm currently programming a Blackjack application in Java and it needs to be written in an MVC architecture. I have all my models, views and controllers fully coded and everything works perfectly. However, I'm wondering what the best way of attaching listeners to components is (e.g, a JButton). My current design declares all components in the view that need listeners as public final. It then passes the view to the controller. From there, the controller has full reign to access the components

Using MVC (Model View Controller) in a Client-Server architecture

时光毁灭记忆、已成空白 提交于 2019-12-22 08:59:51
问题 I'm trying to choose an design pattern for an application that I'm developing. The application is primarily based on a Client-Server architecture where the Client basically reads and writes data to the Server; its not a Web-application however, The client will have to install the software executable and then interact with a GUI in order to communicate with the Server (which exits on a different machine) through an internet protocol. Since the application is based on heavy interaction with a

Spring with FreeMarker: Could not resolve view with name 'Home' in servlet with name 'MyServlet'

自作多情 提交于 2019-12-22 08:19:07
问题 I am trying to create a very simple integration of FreeMarker and Spring. However, when I run my example, I get an exception: GRAVE: Servlet.service() for servlet MyServlet threw exception javax.servlet.ServletException: Could not resolve view with name 'Home' in servlet with name 'MyServlet' at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1162) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) at org.springframework

OO Design Patterns with Perl

自闭症网瘾萝莉.ら 提交于 2019-12-22 08:18:07
问题 I am currently planning the design for a new system I will need to code that interacts with a back-end API. I was contemplating object composition and inheritance and decided that the most correct procedure in my situation would be to go with composition over inheritance as my objects have a "has a" relationship to one another and not an "is a". I find now though that because some objects are reliant on other, there may be cases were "object A" has an attribute which is "object B" and an

MVC - Is it okay for a Model to be composed of a few other models? [closed]

久未见 提交于 2019-12-22 08:17:41
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have two Controllers: one for viewing a single player, and one for viewing a team. I currently have it where the team is composed of

Creating a view controller without a nib

旧时模样 提交于 2019-12-22 07:59:31
问题 In AppDelegate, I want to create a UIViewController subclass and add it's view. The viw itself will be specified in code - there is no nib. Based on the apple docs, I should use initWithNibName:nil bundle:nil]; and then in loadView of the controller, I add my subviews etc. However, the follwing test code below does not work for me. I modelled the AppDelegate code on Apple's PageControl demo, simply because my app will implement a similar structure (specifically a base controller to manage a

Passing parameters to Controller ..but NOT on the URL

你。 提交于 2019-12-22 07:01:32
问题 Is there a way to pass a parameter to a controller without putting it on the URL? For example, http://www.winepassionate.com/p/19/wine-chianti-docg-la-moto has the value 19 on the URL. If you actually change that value to another, the page displays a different record even it the page name remains the same. So I would like to NOT pass the ID on the URL but still be able to pass that to the Controller. What's the recommended way to do so? 回答1: You can do a post and send it as a form parameter.

MVC, DI (dependency injection) and creating Model instance from Controller

喜夏-厌秋 提交于 2019-12-22 06:36:35
问题 My Dispatcher is "choosing" correct Controller; then creating Controller's instance (DependencyInjectionContainer is passed to Controller constructor); then calling some Controller's method... class UserController extends Controller { public function __construct(DependencyInjectionContainer $injection) { $this->container = $injection; } public function detailsAction() { ... } } DependencyInjectionContainer contains DB adapter object, Config object etc. Now let's see what detailsAction()

Attaching gesture recognizers / action methods to views violate model view controller?

孤街浪徒 提交于 2019-12-22 05:35:35
问题 Wanted to ask peoples opinion on this. I have a uiimageview subclass and in it's initializer I add some gesture recognizers to the imageview, and I also include the gesture recognizer delegate methods within class. My question is, does this violate model view controller? Should all the code that has to do with controlling a view be in a view controller? Same with say, putting a button action method in a view. Anyhow, interested in hearing opinions. 回答1: In one sense, yes, this violate the MVC

How to fix HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode

做~自己de王妃 提交于 2019-12-22 05:29:41
问题 I'm learnig about Http modules and during last try I received: HTTP Error 500.22 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. One of the suggested solution is: from the IIS Express install directory, run appcmd migrate config "Default Web Site/". So from Command prompt I went to C\Program Files\IIS Express and then I executed: appcmd migrate config "Default Web Site/" I received command "Migrate" is not supported on