Maverick Grotto

Greenhorn
+ Follow
since Sep 22, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Maverick Grotto

Teja Saab wrote:Thank you Suresh, Shyam and Maverick for your valuable inputs. You are right Maverick that I cannot assume that the partner's implementation uses the replyTo queue to send responses.

I thought about the publish/subscribe approach. However, one of the issues that I am trying to figure out is how to avoid the inventory data from being stale. Let me explain.

(1). Each one of the manufacturers probably have several different partner B2C sites that sell their stuff. Also assuming that the manufacturers publish their inventory data using a publish/subscribe mechanism to all partners, it is just a matter of time before my inventory data becomes stale.

For example, Manufacturer 1 publishes inventory 500 for product p1 to 10 different web sites including the one that I am architecting. I update my system with inventory 500 for product p1. However, another B2C site probably makes a sale of 200 items before me and that reduces the manufacturer's inventory to 300 now. However, my inventory is still showing as 500 (assuming that the next publish is yet to come from the manufacturer). If I make a sale for 400 items, I won't be able to fulfill the order since the available quantity is only 300.



The true inventory resides with the manufacturer. All the other B2C sites show only a snapshot of this "true" inventory. These snapshot inventories are bound to become stale if they are trying to poll the manufacturers inventory on some sort of a timer. The best solution seems to be when the manufacturer utilizes an event driven publishing scheme in which any change in inventory is published to all the subscribers in realtime. Even with this scenario, there is a window of opportunity for stale data being utilized for processing. The only way around this seems to be to validate against the "true" inventory data before using it.

Reserving part of the inventory (as you hinted in your last post) from the manufacturer would definitely help out on the data synchronization front.



I didnot use any transaction management in my solution either.

Teja Saab wrote:I am trying to create the architecture for a system that has an inventory system as one of its components. Assuming that the inventory system contains inventory levels for products manufactured by different companies, I am trying to find the best way to keep the inventory system up to date with the different manufacturer inventory levels. Each one of the manufacturer's systems supports a JMS interface.

The inventory data in the inventory system is used in a B2C site. So response time is important. Sending a JMS message to a manufacturer in real time to find out available inventory while a customer is waiting for the web page to update is not an option.

I am thinking of an inventory synchronization approach with two MDBs. The first MDB registers itself with the EJB container's timer service.
The timer can be set to fire every few seconds or minutes. When the timer is fired, the timer callback method in the MDB will send a request message to each one of the manufacturers incoming queues. The manufacturer will reply back with the availability to the replyTo queue. The second MDB configured to listen on the replyTo queue will process the incoming message and update the inventory system. The B2C site always interacts with the local InventoryManager class which will in turn talk to the local inventory management system. In other words, the InventoryManager class decouples the external manufacturer interfaces from the rest of the application thereby promoting loose coupling.

What do you folks think about this approach?

Thanks for your inputs and critiques.



My thoughts on this.
1. Your solution assumes that the manufacturer jms implementation will utilize the "replyTo" attribute of the JMS message that the B2C site will send.
2. The entire conversation between the B2C site and the manufacturers is too chatty.
3. JMS by nature promotes loose coupling. So in this case, if your solution just subscribes to the manufacturers TOPIC (or listens to the manufacturer provided QUEUE name), you should be good.


Tomasz Romanowski wrote:The more I'm reading up on this the more confused I am. Both the wiki page http://en.wikipedia.org/wiki/Class_diagram ad well as http://www.developer.com/article.php/2206791 are referring to "Analysis Classes".
From what I see "Entity" and "Controller" in that context means something completely different from what I'd call it. They say that Entities contain business logic whereas Controllers don't contain any business logic but merely transfer the control to the appropriate business logic (Entity?) class. My understanding of a controller and an entity is that an entity represents a domain object (i.e. customer, order item etc) whereas a controller woudl be a business logic class very likely to be mapped to a stateless session bean.
Thoughts?



I see analysis classes as a rough draft or in other words a precursor to the final detailed design. The analysis classes tend to be centered around the conceptual business model.
When we delve more into the details of the actual business solution, the other components like the controllers and managers that work with the analysis classes aka domain classes take shape.

Controller in my mind is a component that might encapsulate the entire business logic. To accomplish its task, it might delegate to another business component which might be an EJB, POJO or SERVLET.

Entity as you said represents the business domain object but it also means that this object manifests itself in the database via persistence.

Tomasz Romanowski wrote:It is not clear to me what stereotypes are allowed in class diagrams. I want to flag one of my classes with a <<DataTransferObject>> stereotype but I've come across a few statements that make me believe that UML 2.0 specifies what stereotypes are allowed in class diagrams which would make it illegal to use anything beyond the defined set.
Martin Fowler's book "UML Distilled Third Edition", page 66 reads:
"In UML 2, stereotypes are defined very tightly, and describing what is and isn't stereotype is beyond the scope of this book". The wiki page http://en.wikipedia.org/wiki/Class_diagram lists only three stereotypes, Boundaries, Entities, Controls. Not sure if this is a complete set or not.



Interesting question.. I am not sure what the true UML norm is but I have come up with my own stereotypes in the past. However I must say that I have been rather cautious in coming up with new stereotypes.. I try using stereotypes that are commonly understood by the community in general.. and if not, I do provide an explanation of what the steretype means.

In the example you provided <<DataTransferObject>> is a commonly understood design pattern and you might be OK to use it as a stereotype.

Chih-Wei Lee wrote:Hi Maverick:
Congrat!

How did you submit your assignment?
Did you submit your assignment via CertManager or email?



I submitted the assignment via email. I got an email from Oracle asking me to attach the assignment in the email and send it back.

The email that I got from Oracle was different from the one listed on the certmanager site.

I submitted part 2 on March 10th, 2010, took part 3 on March 18th, 2010.

I got back the result on April 13th, 2010.
Hi all,
I received an email from oracle today congratulating me on passing SCEA. The sun certification database shows that I have passed the exam but the certmanager site is still not updated.

Thanks everybody for your valuable insights.

Heres my take on the passing this exam
1. I DID NOT CHANGE the provided domain model. In other words I maintained the relationships between the different entities in the domain model. I did add a few classes to the domain model but in doing so I was careful to maintain the original relationships.
2. BEING SIMPLE YET COMPLETE
I did not get bogged down on details of the actual layout of the GUI screens but rather concentrated on the business functionality these screen must fulfill. Using AJAX or not as a communication style between the browser and the server does not make or break the solution. So I did not elaborate on this.
I made sure that the UML diagrams were complete and consistent across all types of diagrams; Component, Class and Sequence. In other words, all the artifacts in the class diagram were accounted for in the component diagram and all the methods in the sequence diagrams were present in the class diagrams.
3. I used standard J2EE design patterns along with GOF patterns in my solution and explained briefly why I used them.



It depends on which layer you are going to use BusinessDelegate in.

Generally speaking a BusinessDelegate is used in the presentation layer, so that the presentation tier has access to the business functionality in a uniform, simplified manner. But there might be a case where one business component (A) has to call another business component (B). In this scenario, a business delegate to component B will reside in the business tier.

To simplify things, if we think in terms of client and server, the business delegate will always reside in the client.

The client could be residing in the presentation tier or the business tier.

But again generally speaking, Business delegate resides in the presentation tier.

I hope this helps.
It is ironic how the SCEA solution is being judged on reliability amongst other things when their own certification system is unreliable and does not honor SLAs.

P Das wrote:This is interesting; they took initially <4 weeks; then another 2 1/2 months.

However, my case was an exception: you may expect the usual timeframe between 4 and 6 weeks.



Congratulations P Das.

I had been sitting on my assignment for about 1 year. I submitted my assignment on the last day of the 1 year expiration period and gave part 3 the following day. Its been over 2 weeks since then and I am waiting eagerly for the results.
Passed SCEA today (81%)..

16 years ago
class MyClass
2: {
3: static int maxElements;
4:
5: MyClass(int maxElements)
6: {
7: this.maxElements = maxElements;
8: }
9:
10: }
11:
12: public class Q19
13: {
14: public static void main(String[] args)
15: {
16:
17: MyClass a = new MyClass(100);
18: MyClass b = new MyClass(100);
19:
20: if(a==b)
21: System.out.println("Objects have the same values");
22: else
23: System.out.println("Objects have different values");
24: }
25: }


What would be the result of this?
>> This would also return false.

I keep getting confused when to use .equals and the == operator.
Can someone clear this up for me?
The default behaviour of equals and == is the same. Only the references of the objects are compared and not their contents.

However the default behaviour of equals can be overriden and you can provide the logic where the contents of the object are compared rather than the references.

For example, the String class has an overriden equals method that compares the contents of the String.
String a = new String("abc");
String b = new String("abc");
a.equals(b) will return true since the contents of the object pointed to by the reference variable a is the same as the contents of the object pointed to by b.
a == b will return false since the references are different.

There are some objects that donot have the equals overridden, just like the code listed by you. In that case the behaviour of == and equals is the same.
I hope this helps..
In the code fragment listed, you have not overridden the equals method. The default implementation of the equals method compares the references and not the contents of the object pointed to by the reference. Since you created two new objects, they have 2 different references and therefore the equals method will return false. Thus D is the correct answer.