Thursday, July 10, 2008

Boring life

life has really been not going anywhere. For the past couple of months i have not been doing great in personal front. i mean nothing special. Have not visited any place of interest , not done any trekking that i had been planning. Neither have i been to any scenic places. Watching movies is what i have done on good number of occassions. Have watched de taali Ayesa takia starrer. Do not doubt my choice, cause this pick was not mine. I had watched Ready of genelia dsouza and ram. The movie was a good laughing riot. Brahmanandam the telugu actor who entered guinnesss records was good as usually.

Also watched Jaane tu yaa jaane na.. nice movie. Though it is a routine movie story line the acting was different. Presentation was way too different. Comedy scenes came very good. Genelia had a role which wsa probably tailor made. Not so brainy and childish kinda role. Naseerudin shah left his mark in the movie at the end.

The same day was the dream final between Fedex and Nadal. My friend Arun said he could not watch the match so we went to the movie. By the time we returned the match was 2 sets past and Nadal made a dream comeback in the 2nd set down 3 points and winning the set 6-4. In the 3rd set and 4th set he was not so lucky and the set went into tie-breakers.

Style size feature

Hmm my third blog on Style size feature.

In my previous blog i was telling about how the feature was implemented. We have a stylecombination object for each item and styleattribute object which would contain the stylecombination objects in a arraylist. Since we do not how many styleobjects would exist for each attribute i had used arraylist to create the styleattribute. other requirement is to have level for each attribute that is to say, if there is an attribute Red color, at the level 2, then we should know that what is the level or attribute name for the Red color. Hmm using the styleattribute objects we would know how many attributes should be shown on the UI. and using the level we could create the options at the right place.

So when the user has selected an option we can enable disable the rest of the options based on the stylecombinations that each attribute has and finding out the attributes available for each stylecombination object

Sunday, July 6, 2008

Style Size continue

Solution:
I took a whole month and more to get me back to blogging again. Well the solution was hard to get at. I mean initial design was to go with a tree diagram and the best solution for that seemed to be a XML structure. The best example for a hirearchial structure starting with a dummy root element and then having child elements to it, such that we have a structure from the first child to the children the combinations possible.

The list of items would be giving the combinations possible. Creating the XML would be the first step, next step would be painting the UI using the XML which would be pretty straightforward. Since we have the xml any selection made can tell at what level it fails. But this would be restrictive to the user since he would have to mke sequential selection instead of starting at any point he might wish to. So this design was not declined and there i was starting all over again

Here i got help from my manager. the new design was to create java objects which would be used to paint the screen. The object design was that instead of like in the XML model where we had only one way of navigation, here we would have objects for each attribute. But all the possible combinations would be made into one object called as StyleCombination. That is say if the item1 has attibutes of Regular super size, Red Color and Small size, the style combination would contain Regular, Red,Small as the object.

This way we would have to deal with objects and this would not be hirearchial too. So the next challenge was to tell me what are the style combinations that a particular object belonged to. So the ideas was to create a collection object for each attribute. This collection would contain the style combination as the objects. But one problem was to maintain just as many combination objects as there are items. And have the attributes belonging to the combination should refer to the same combination object instead of creating one more. That is the combination object Regular,RedSmall would be created only once and the collection for Regular , red and small would all contain this same object which is quite obvious. This way the memory would not be used much and we know if we have to update or change the property of item1 all we would have to do would be to change the property of the object and it would be reflected for other attributes too.

The way to create only one combination object can be done by overwriting the equals method to tell during comparision that these two objects are the same.

Rest of the painting adn selection was sounding to be very easy since we now have the model ready and the object hirearchy ready. But it did not turn out that esay since we had to include availabilty into picture and use paint listeners too. Rest would come in another blog. thats for today.