Who does the glue?
Crossposted to algorithms forum.
I am writing an application using a Model-View-Presenter pattern. In these applications, who is responsible for "gluing" the pieces together? How is this glue logic tested?
For example, I am creating a login dialog box. It includes a view with the usual "username" and "password" text fields, and a "login" button. I have a presenter whose constructor takes an ILoginView interface object and an ILoginModel interface object. It sets itself up as the ActionListener for the login button, etc.
Who calls this constructor? How is that code tested?
Continuing on in the application, who creates other dialogs and their respective presenters and models?
Are you using Factories and replacing them at test time with versions that return mocks?
What about displaying errors? Suppose the user enters an invalid password. Who is responsible for showing a message box? How is this tested?
Thanks.
I am writing an application using a Model-View-Presenter pattern. In these applications, who is responsible for "gluing" the pieces together? How is this glue logic tested?Never heard of this pattern. Perhaps you meant Model-View-Controller?
>
For example, I am creating a login dialog box. It includes a view with the usual "username" and "password" text fields, and a "login" button. I have a presenter whose constructor takes an ILoginView interface object and an ILoginModel interface object. It sets itself up as the ActionListener for the login button, etc.
Who calls this constructor? How is that code tested?Your "bootstrap" class. The code that sets up the stage and then start the show.
The code (any code you write) should be tested with JUnit tests :)
>
Continuing on in the application, who creates other dialogs and their respective presenters and models?Same as above.
This "wiring" process of ensuring that all objects have their dependencies correctly setup could be done manually by you (writing the "glue" code in the bootstrap class) or by a DI container (like Spring, PicoContainer etc).
Similar Messages
-
ConnectionFactory - who does the load balancing
Consider creating a connectionfactory (with server affinity unticked, load balancing
ticked and using the message delivery policy of round robin) we then go on to
create a distributed domain targetted at the cluster of two managed server's (managed1
and managed2)
If I create a simple java app that put's messages to that distributed destination,
using the connectionfactory above, who's responsible for doing the load balancing.
Does the client create the session knowing that the connectionfactory requires
load balancing and thus takes the responsibility for it, or does the client just
put a constant stream of JMS messages to the WLS and the connectionfactory class
takes responsibility for the load balancing
Who maintain's the delivery state, the client application or WLS (i.e who's job
is it to look up the last messages queue destination?)
Hi Barry,
A JMS client's produced messages are first delivered to the WL server
that hosts the client's JMS connection. The JMS connection
host remains unchanged for the life of the connection.
Once produced messages arrive on the connection host,
they are load balanced to their JMS destination.
For more information I suggest reading the clustering
sections of the JMS Performance Guide white-paper. You can find
the white-paper here:
http://dev2dev.bea.com/technologies/jms/index.jsp
Tom Barnes
Barry Myles wrote:
> Consider creating a connectionfactory (with server affinity unticked, load balancing
> ticked and using the message delivery policy of round robin) we then go on to
> create a distributed domain targetted at the cluster of two managed server's (managed1
> and managed2)
>
> If I create a simple java app that put's messages to that distributed destination,
> using the connectionfactory above, who's responsible for doing the load balancing.
>
> Does the client create the session knowing that the connectionfactory requires
> load balancing and thus takes the responsibility for it, or does the client just
> put a constant stream of JMS messages to the WLS and the connectionfactory class
> takes responsibility for the load balancing
>
> Who maintain's the delivery state, the client application or WLS (i.e who's job
> is it to look up the last messages queue destination?)
>
>
>
>
-
I have a class Foo1 which implements java.io.Serializable.
I have another class which performs this function:
private void saveSettings(String sFilename)
try
FileOutputStream fileOutStream = new FileOutputStream(sFilename);
ObjectOutputStream objOutStream = new ObjectOutputStream(fileOutStream);
// Output to the stream
objOutStream.writeObject(param);
objOutStream.flush();
objOutStream.close();
fileOutStream.close();
objOutStream = null;
fileOutStream = null;
catch (IOException ioeEx)
JOptionPane.showInternalMessageDialog(getContentPane(), ioeEx.getMessage(),
"Unable To Save Settings", JOptionPane.INFORMATION_MESSAGE);
} My question is should Foo1 one implement this method and if so should it also have a load function declared as static methods?
I am not sure where the serialization code should go.
Thanks for any adviceI used to place the methods on the Foo1 object but Idecided that an object/class should not be resonsible
for knowing how to save itself.
Just curious, but why did you come to that opinion? To
me it would follow then that if you could, you would
put the constructor for a class in a helper class
too.An object that knows how to save itself would also have to know on what to save itself. It would therefore need to know if it needed to be turned into a file on disk or just into a byte array to be stored in a database.
It would also need to know whether it should be stored as XML or as a serialised object.
>
For instance, what if there were violatile member
variables in an object, where would these be
initialized on load?I'm not sure I understand this! Do you mean 'transient'?
Roger -
I will be purchasing RAM from a different retailer for my MacBook Pro. Who does the apple store recommend. I live in Denver, CO.
Any local PC or Mac service can install it, a good local geek, you can do it yourself if you wanted too.
Only if it's the MacBook Pro Retina nobody can, it's sealed up.
You will need to make sure you got the correct RAM specs, so visit Crucial.com and use their system to make sure. (cheap RAM is bad for Mac's and wastes your time opening it up again to replace, so spend the money up front)
Next you will need tools and watch a video, it's really easy.
http://eshop.macsales.com/shop/accessories/Tool_Sets
http://eshop.macsales.com/installvideos/
Tips, don't touch any contacts, discharge body static and place each screw into a egg crate or plastic compartment so each screw goes back exactly into it's respective hole.
Your warranty/AppleCare will not cover the new RAM, or anything broken inside replacing it, so beware and be careful. To have that coverage you need to have Apple replace the RAM at a huge markup of course.
note: no compensation for site or product mention, used to illustrate only, not a product or service recomendation. choose who and where you want to buy. -
How to find a customer who does not have any activity in the last 5 years
HI all,
How to find a customer who does not have any activity in the last 5 years.
Thanks & Regards,
Moderator message: not directly related to ABAP development, please have a look in the respective functional forum.
Edited by: Thomas Zloch on Jan 3, 2011 2:20 PMPost Author: tzinser
CA Forum: Formula
Okay, I left off a lot of important information...
I'm using two tables
TWDATA
EVENT
From TWDATA I'm pulling the fields TWDATA.OrderNumber and TWDATA.DisbursementDate
From EVENT I'm pulling the fields EVENT.EventCode and EVENT.CompletedDate
The two tables are linked by OrderNumber. -
My macbook keeps asking me to use an administrator and their password to continue but nobody seems to know who is the administrator for this computer...does anyone know how to avoid this this or figure out who the administrator is?
Lynne130,
to figure out which users have administrative privileges, open the Users & Groups pane of System Preferences; each user other than the Guest User will be shown with a description of either “Admin” or “Standard”. It’s typical for the first user created on a Mac to be an administrative user. -
Ram Upgrade Does it mater who makes the memory card?
I have a 2007 20" iMac wtih at 2.4 Ghz Intel Core 2 Duo with 1 GB 667 MHz DDR2 SDRAM
I am going to upgrade from 1 GB Ram to at least 4 GB and maybe as much as 6 or 8 depending on pricing?
Does it matter who manufactures the memory card?
ThanksThe mid-2007 and Early 2008 iMacs officially can accept 4G of RAM (two 2GB modules); with newer modules made since Apple engraved the specs in stone, you can go to 6GB RAM (one 2GB +2 4GB) but no more.
The only brand issue I've encountered is that some Intel Macs using PC2-5300 RAM were rather unhappy with Kingston "Value RAM." The regular line fo Kingston was fine.
For the past decade, I've web-ordered all my Mac RAM (and we have 16 Macs in the family) from only two vendors. I have never had RAM go bad or received the wrong RAM from these firms. Then there is the added pleasure of their being among the lowest priced. Here are their listings for PC2-5300 for your iMac:
Other World Computing:
http://eshop.macsales.com/shop/apple/memory/iMac/Intel_Core_2_Duo
Data Memory Systems:
http://www.datamemorysystems.com/_apple_info/Apple_Aluminum_Intel_Core_2_Duo_iMa c_20_2.4GHz_Memory_1467.asp
You don't show a geographic location in your profile (a very useful thing to include around here ) so I've listed US firms because that's who I use. If you are somewhere other than North America, let us know and someone may be able to provide resources local to you. The first firm I linked ships internationally with only a very "can't do" countries, but shipping and VAT may make it less attractive than a local source. -
How do you create an Apple ID for a student who does not meet the "minimum age" requirements?
A parent/guardian has to create it and supervise its use.
-
I'm having trouble with my iPhone 5 iMessage service. The device does not recognize the users who have iMessage when I try to contact them using this feature. Who have the same issue and what did you do in order to solve it?
Read here:
http://support.apple.com/kb/ts2755 -
Hi, Does anyone know if the Ipad 2 has hand writing recognition? I want to buy one for an aged parent who does not type. Thanks
There are apps that will do handwriting recognition, such as Writepad HD. However, I suspec that such an app would be even more of a challenge to an older person than trying to use a keyboard.
-
Does the person who you gift a song to need an apple id to download?
does the person who you gift a song to need an apple id to download?
cheersThey need an iTunes ID, yes.
If they do not have one, they can create one redeeming the gift you send them. -
Hello. I have an iPhone 5S. Does anyone know who manufactures the SIM card Verizon uses in the 5S? Thank you.
Hello Erin and thank you for your quick reply.
My concern is in regards to the recent revelation that the NSA hacked into Gemalto's systems and has access to the encryption keys for SIM cards that Gemalto has produced over the last five years.
https://firstlook.org/theintercept/2015/02/19/great-sim-heist/
Matt -
Miss Steve! who is the next one does his Job???
I'm a loyal Apple Fun, never miss anything from it and trust it and always fellow the new updates. But since iOS 6 came out until now the new iTunes shows up, my nightmares have came.
I can not sync my iPhones and iPod with the new iTune. The round sync sign is turning in hours and hours but never does the works, nothing happened. I close iTunes then reopen, but it never shows up, I have to restart my PC to reopen it. It worked well before. So I don't want to try sync my iPad.
I updated all my device to iOS6. The devices work very slow and eat battery very fast. When I used iPhone 4S, I could use full battery for the whole day, then I charged it at night. But use iPhone 5, I need to charge the battery 2-3 times a day, it's the same usage as before. The worst thing is the Google calendar, for syncing one even with my PC Windows 7, it takes about 15mins, sometimes even takes longer. When I used my iPhone 4 and 4S, it took just 2-5 seconds. I use my iPhones, iPad, PC Google calendar for my work, it's very important for me to get instant sync between them.
And another worst thing is to open my email accounts, it took about 5- 10 mins to get my emails, drafts and switched between my email accounts. The iPhone 5 gives me a very big trouble, I've got headache everyday and expected iOS6.0.1. But it did not help much, the problems are still with me. I had to delete another email accounts, just left one gmail account to keep my work going, it helps me. But I still have the problem for sync google calendar evens between my devices.
<Edited by Host>You fix it by purchasing the apps on the Mac App Store. These apps come free with a new machine, not a used one.
-
What does the Mac Pro do? and who uses it?
Hey guys, I want to know What does the Mac Pro does and which type of people use it.
To add a slightly less technical perspective, I bought a new Mac Pro because it fits my preferred working style rather than because I need its specific computing power (And also because my 2008 MP crapped out and I got tired of fixing it).
When my old Mac Pro died, I ran out and bought a Macbook Pro Retina and used it as my desktop while waiting for the new cylinder MP. The MBPr was stunning and performed like a champ. However, I was reluctant to use it as a laptop (i.e., travel with it) since it was my sole platform for client work and I didn't want to jeopardize my ability to work/deliver should something nasty happen on the road.
So maybe I'm a bit old fashioned, but I like to have a desktop mac for my primary workstation (I'm a graphic designer and photographer) and a laptop for the road. I use a high-end, wide spectrum monitor for color critical work, so while it's true that an iMac would have the power to run the stuff I need, I prefer to have options with my monitor.
Again, just another perspective that might factor into a purchase decision. How do you like to work and what works best for your situation? It isn't always mandatory to have the fastest and latest (unless, as in my case, it falls into your established criteria/working style). -
HT204158 does the ipad smart case have a warranty
Does the iPad smart case have a warranty?
Heidi,
I purchased a smart case as a gift for a relative, at a local Apple store. In a few months it developed the same problem as your case. I took it back to the Apple store and was told there was a 1year warranty which covered manufacturing defects, as long as the product was not abused. I told them that the glue problem was a Factory defect and I wanted a replacement, which was granted to me. Talking to someone face to face does give you more leverage than talking to phone personnel who might be a few thousand miles away. So, if you have an Apple store in your area, you may get better results there.
Maybe you are looking for
-
USING TEMPLATE IN A DIFFERENT DATA SOURCE BUT WITH THE SAME GL QUBE
Hi, I want to chance connection in a SV Workbook to another data source. As we are having several test instances I need to be able to use the same Query workbook on different instances. I've not been able to reproduce the steps to get the SV to ask f
-
How to access a web service from a XLet
Hello, I am new in software development to ITV and I dint find too many usefull information teaching how to access a web service from a XLet running in a STB. Are there anybody who can give me some help, maybe sample or tutorial? Gratefull David
-
Implementing Rank / Partitioned Index
Has anyone implemented a partitioned RANK in Power Query? I understand I can Sort and then create an Index, but how can I define partitions for the index? Is there some way I can make it restart with each new partition value? For instance, I want to
-
I am using Sigar dll for showing Physical memory... class Memory() ArrayList<HashMap> al=new ArrayList<HashMap>(); public void EatMemory() while(!Stop) al.add(new HashMap()); //Condition here // St
-
Hi there, I installed ColdfusionMX 7 on WIndows 2008 R2 Standard server. When I try to open the admin page , I Get the error: Server Error in '/' Application. Could not load type 'C:\CFusionMX7\runtime\lib\wsconfig\jrun_iis6.dll'. Description: An unh