MVC (I'm gonna get it right this time)
When I started my project, I didn't even know what Model-View-Controller was. Now it's all to clear that my app is totally convoluted because I didn't use it. So I want to get it ABSOLUTELY right this time. I'm hoping to get a better idea of the responsibilities of each part
the closest thing to my project would be a midi sequencer.
What I know,
the model objects should contain all the data of where notes appear, velocities, tracks etc.
The view contains the code to draw to the screen and interpret user input.
What I want to know
� How to split responsibilities between the view and the controller?
� Should a list of the currently selected notes be stored in the view or controller?
� When the user clicks and drags some selected notes, What should the message from view to controller be?
ie "clicked and draged" or "change pitch of selected notes" or "change pitch of these specific notes????
� Should the view remember all the notes on a track or just the ones currently in view?
� Which part should do the reading/sending of notes the controller or the model?
Obviously the view objects shouldn't be as "stupid" as my computer monitor, but I'm still a bit confused... can anyone shed some light on the subject or provide some good reading? all the examples I see use simple 3 button apps which aren't very educational in terms of concepts
thanks all,
-matt
ps(I wont be using the included midi sequencer objects)
Edited by: Mat on Nov 7, 2007 2:55 PM
Your question requires a whole session on MVC pattern but to summarize the explanation to understand it practically, here are the components and where they fit in MVC.
Database - Model
JSP - View
Java/EJB/etc - Controller
Lets take an example for the above 3:
You have a user registration page, once the user enters his details, they will be validated and stored into a database table.
So the user registration page will be our JSP page and will be the view, this JSP page will invoke the controller which is nothing but a java class that handles or validates the data inserted by the user on the JSP page. This controller will then insert this data into the database table. Once it is successfully inserted, the controller java class will send a message to another JSP which will again display that message to the end user.
So this is how MVC works.
I hope this helps you a bit.
Choicest Regards
Amit Singh Rathore
www.proamit.com
Similar Messages
-
You'd Think They'd Get It Right This Time
As the owner of a 2-day old sleek...
My mother" " headphone jack is loose.
Creative, WTF?!?!?!?!?!?!
How are you continue to be this ignorant. You make an AMAZING player, and go ahead and let something little like a headphone jack mess it all up. You've seen these hundreds of people complain. DO SOMETHING ABOUT IT!!!!
Makes we wonder if its worth getting another one...Rockin, didn't you post in another thread that you were playing ball while wearing the SleeK?
"my sleek is amazing and highly recommended. unfortunately, the headphone jack just came loose about 20 seconds ago. i just came on to check if this is a common problem. it might be since i played b-ball with it "
http://forums.creative.com/creativel...ssage.id=83296
It is not a good idea to play ball while wearing any music player, especially one with a hard dri've.
MP3 players are not intended for such rugged use. -
Is this true that iphone 5 is gonna get released by this year end??
Is this true that iphone 5 is gonna get released by this year end??
Only Apple knows if and when the next version of the iPhone will be released and what that will be called.
No one here knows as we are just users like yourself.
Anyone that may know is bound by a non-disclosure agreement. -
How can I get rid of this time code bar at the top of my rendered/exported video?
This is the video after I rendered:
This is the setting I used:That problem has nothing to do with format settings. It is a burn-in, which is set in the view settings (timeline panel), and also you can deactivate in the render settings.
-
FUNCTIONS (maybe I got it right this time)
Sheesh! Not being able to use the "reply" on the list is a pain, but not near the pain & embarrassment of posting a non-functional function as I did earlier.
Copied below, with sqlplus results documenting the test efforts, is a function that will return the number of quarters between two dates.
CREATE OR REPLACE FUNCTION quarters_between (
early_date date, late_date date)
RETURN number
IS
first_date number;
last_date number;
interim number;
difference number;
BEGIN
first_date := to_char(early_date,'yyyy');
last_date := to_char(late_date,'yyyy');
interim := nvl(last_date - first_date,0);
IF (interim != 0) THEN
interim := interim * 4;
END IF;
first_date := to_char(early_date,'q');
last_date := to_char(late_date,'q');
difference := (last_date - first_date) + interim;
RETURN difference;
END quarters_between;
SQL> SELECT quarters_between('27-AUG-03','19-FEB-04')
2 FROM dual;
QUARTERS_BETWEEN('27-AUG-03','19-FEB-04')
2
SQL> SELECT quarters_between('27-AUG-03','07-NOV-02')
2 FROM dual;
QUARTERS_BETWEEN('27-AUG-03','07-NOV-02')
-3There. Now I can sit down and shut up.Heyy.. you dont have to start a separate post for each reply.. There is a button named "Reply"... Use that......
If you are trying to add the two arrays then what you have done is wrong....
Try this
//declare c
int [][]c=new int [2][2];
for(i=0;i<2;i++) /// its a 2 dim array so i<2..
for(j=0;j<2;j++)// again 2 dim array
c[i][j]=a[i]+b[j];
//print
//you do it -
Can I get an answer this time around?...
Im looking for an inexpensive mountable video light for on the fly interviews. It just has to able to be dimmed, not just have the average on/off switch. I dont mind lugging around the battery packs and Im only looking to spend less than $150 on the lights/package. Links and reasons would be well appreciated.
Thanks!
TrollsyAlright, Scratch the old budget, how bout less than $300. Im doing on the fly interviews and I want them to come out looking superb. I have came across a whole bunch of bescor but Ive only used them once or twice, not enough time to really establish whether they are good or not. I noticed their low price range and was just curious if there are other similar lights that would be comparable, if not better. and how they stacked up against other pro lights. Thank you, and I am sorry I dont know that much!
Trollzy • • -
How do I get rid of a timer symbol in the middle of my screen ?
Someone please tell me how to get rid of this timer symbol that stays in the middle of my screen ever since I installed the HP software for my Deskjet F2280 printer, this symbol still appears when I close the software and/or disconnect my printer and its really annoying at times and I thank anyone who helps me with this.
This question was solved.
View Solution.Zigglos, welcome to the forum.
Here is an guide that may help solve your problem.
Please click "KUDOS Thumbs Up" if I have helped you and click "Accept as Solution" if your problem is solved.
Signature:
HP TouchPad - 1.2 GHz; 1 GB memory; 32 GB storage; WebOS/CyanogenMod 11(Kit Kat)
HP 10 Plus; Android-Kit Kat; 1.0 GHz Allwinner A31 ARM Cortex A7 Quad Core Processor ; 2GB RAM Memory Long: 2 GB DDR3L SDRAM (1600MHz); 16GB disable eMMC 16GB v4.51
HP Omen; i7-4710QH; 8 GB memory; 256 GB San Disk SSD; Win 8.1
HP Photosmart 7520 AIO
++++++++++++++++++
**Click the Thumbs Up+ to say 'Thanks' and the 'Accept as Solution' if I have solved your problem.**
Intelligence is God given; Wisdom is the sum of our mistakes!
I am not an HP employee. -
Me and my daughter had been using the same apple id, she was triyng to change it, now all of my iphone contact are gone, what can i do ti get it back , this is very important to me.
Your contacts are helpd on the server, so if you sign out from your iCloud account and sign into another one they will disappear. If you sign back into the original account they will reappear.
-
I have Iphone 4 and its lock from at&t, but my contract is getting over in short time. And no longer i want to use this service. So after contract gets over its my right to get factory unlock my iphone 4.
jatpri1730 wrote:
I have Iphone 4 and its lock from at&t, but my contract is getting over in short time. And no longer i want to use this service. So after contract gets over its my right to get factory unlock my iphone 4.
Unfortunately, AT&T does not provide unlocking.
Stedman -
I was using my notes earlier today and now for some reason they are all gone. How does this happen and is there anything I can do to get them back, the new ones also that haven't been synced.
See Recover your iTunes library from your iPod or iOS device.
tt2 -
AOL says it's your browser that is causing this, not AOL and it makes AOL pretty useless to use on Firefox. Much easier to use Windows Explorer. Can you get rid of this "browse or add plug in" bar? How do I get around this? Using Firefox on a Windows Vista operating system.
Opening in the sidebar is the default for bookmarks that are created via a link or button on a website.
You can check the properties of a bookmark via the right-click context menu in the sidebar (Ctrl+B; Command+B on Mac).
In the Bookmarks Manager (Bookmarks > Show All Bookmarks) you can click the More button in the Details pane at the bottom right.
Make sure that "Load this bookmark in the sidebar" is not selected. -
I do not want to update to Lollipop right now. How can I get rid of the notification that wants me to install. It says 'Install Later' or Install Now. I don't want to do either so how can I get rid of this notification that keeps popping up?
You cannot stop it from popping up.
it will continue every few minutes until its installed.
just keep using the back button near right side of home button. -
I am having trouble understanding my ipad going to the app store it comes up with a greyed out page withe a bright centre for installing a program i do not want
How can I get rid of this? it is bugging me
HerbetteI'm not exactly sure what you are seeing and what is happening, but try closing the App Store app, and then reset the iPad. See if that takes you out of that screen and allows you to navigate freely again.
Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the App Store app and then swipe "up" on the app preview thumbnail to close it.
Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up. -
After purchasing the Photoshop cs6 update for my Mac, the download page says for "Windows". Will this still work? How do I get the right download without purchasing again?
no.
you need the update for a mac, not windows.
Product updates -
guys!!!! i forgot my itouch password and now it's totally disabled... what else i can do?? i mean my itouch5 is never been sync to any computer... pls help me to get rid of this passcode!! and do all my data and apps will be gone or will it be there?? pls
Forgotten Screen-Lock Passcode
Connect the iOS device to your computer and try to make a backup
iOS: How to back up
Then restore via iTunes. The iOS device will be erased. Place the iOS device in Recovery Mode if necessary to allow the restore.
If recovery mode does not work try DFU mode.
How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
For how to restore:
iTunes: Restoring iOS software
To restore from backup see:
iOS: Back up and restore your iOS device with iCloud or iTunes
If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
You can redownload most iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
Maybe you are looking for
-
How to recover contacts from nokia 3230 memory?
I have Nokia 3230 mobile, it is now having problem in getting powered on. I contacted the nearby Nokia care center, they told they can reset the phone, but all sms and contacts will be erased. But I need to recover all my contacts from the phone. I b
-
About draging something with mouse
when I press mouse and drag mouse ,I want to create a icon at the side of mouse cursor. When I drag the mouse cusor above a JTable or release mouse which cell or row would fire events. How to do it?
-
Is there a suitable porlet-addin for JDeveloper 10g 10.1.3EA
Is there a suitable porlet-addin for JDeveloper 10g 10.1.3EA and if so where might I find it. The one I found produces the following error: Severe(2,369): No class def found for addin oracle.webdb.jdev.PortletDevelopmentAddin OR Is there a workaround
-
HT1296 How do I pull up photos and texts messages from my old iphone if i dont have it anymore
How do i pull up old photos and text messages from an iphone I no longer have
-
Please Make A Validated Woman Out Of Me!
Hi, I am having a problem validating a html page that usses an embed tag, any easy fix for this? I would like to keep the page html. Or if anyone may know of a slideshow that I can use that does not require the embed tag, or how to insert this one wi