In for loop, first initialization part will be executed, then condition part will be executed, then it executes the method body. At the end of method body execution only, the third part incremental will happen. Both pre-increment and post-increment will have same effect here.
My suggestion is to construct domain model first(from the requirement analysis) then from there build object model and datamodel(object model and datamodel need not depends on each other, for any mismatches between these models can be addressed in OR mapping)
XML over HTTP for accessing services thru intranet/internet is good for coarse grained (high level) services. In FBN, it may involve a lot number of small functionalities, using XML over http for this implementation will increase development time(Constructing business objects to and from XML) and runtime overhead.
This shows a many to 1 relationship with Customer and Account. i.e An account can have reference to three accountholders differs in roles(Primary, Secondary and Proxy). But from customer perspective I believe there wont be any need to find 'for which account this customer acts as a secondary or proxy holder'.
Based on the above assumption, define a many to one relationship between Customer and Account. And Customer has composition aggregation with Role interface. Define three classes (Primary Holder, Secondary Holder and Proxy) that implements Role interface. Customer class has reference to Role interface (one to one). The operations defined at Customer class should be delegated to Role interface.
I used the following material for my part I preparation.
1. SCEA guide by Mark cade 2. SCEA guide by Paul allen 3. Head First EJB 4. Head First Design Pattern 5. UML Distilled 6. All SCEA online resources and Mock exams provided in Javaranch 7. Whizlab exam simulator for SCEA
After going thru Struts framework, my understanding about that is, each action is associated to a Class file. In this case, is it good to apply Struts framework for a B2C application having hundreds of unique actions. I think, the controller in this can be designed such that it groups logically the actions triggered by the user and assigns each specific action to a separate method.
In struts, each user action is mapped to a separate action class.
This is because in runtime JVM checks for what all are eligible methods that can be invoked by the given method call. If it finds more than one eligible methods, then it chooses the method which can be safely called. i.e Here in this case, method which accepts Object of type C is called.
Because Object C is of type B and also of type A. If you break the inheritance hierarchy, then you will get compile time err.
both x2 and x3 shud refer to the same object. so, x2 and x3 shud be still on the heap
You are right. But a small correction, x2 and x3 are not objects, they are references to object. In this case after line 9, references x2 and x3 are pointing to the same object only. The objects that are eligible for garbage collection are those created at line 4 and 5.(hence the answer 2)
I would say, if an object is not reachable by any part of the code, it will be eligible for GC and will be collected in the next GC cycle(scavenge GC cycle incase of young objects, FULL GC cycle incase of old objects).
Someone has higlighted a term island of isolated objects. Can any one explain me what it means?
So, (B) is perfect for the code you have given, but if the SetXY is not changed, I will still stick to (C).
B is true, even without adding a sleep. This will happen if you run the above code in Time sliced OS(UNIX) with a lot of threads calling setXY and check method. Also, since setX and SetY are private methods, can't be called any threads directly.
Sending email to customer about the status/completion of transaction should be asynchronous based on Messae Queue model. Because
1. Throughput of the application should not get affected because of sending mails to customers. 2. Also mails sending should be fail-proof, ie if the system fails in the first time while trying to send the mail(say Mail server is down), it should attempt again, until the mail is delivered successfully.