I have a question which i hesitated to ask, but since currently we have expert on duty , i'd like to use such an opportunity. Dear Mr. Ford:
Well, i'm implementing sort of inventory database. One of main features in it should be easy tracking of locations of different items. The problem here is that it's not a warehouse's inventory where all aisles and shelves have numbers; this is much more chaotic environment - regular scientific lab with a lot of refrigerators, cabinets and stuff like that. The initial idea was to build tree structure - each location is either parent or leaf with top locations having null parent (i have similar relationships in another part that implements protocol management but there situation is much easier). For example: null -> room 203->Brian's place->small freezer -20C->top shelf->Brian's box Table looks something like this (in MySQL, need some refinements, never mind): CREATE TABLE Locations ( LocationID INT NOT NULL AUTO_INCREMENT, LocName CHAR(80) NOT NULL, LocDescription TEXT, LabMemberID INT DEFAULT NULL, ParentLocID INT DEFAULT NULL, INDEX(LocationID), CONSTRAINT pk PRIMARY KEY(LocationID), )TYPE=InnoDB; It should work ok when i am presenting the item's details because the chain is not difficult to pull from db, but i have very vague idea about how to build convenient user interface for easy creation of new locations, and also the user should be able to create location on the fly: while filling out another form and at the same time he/she should have easy access to already defined locations. I cannot build mental picture of all those combo boxes and text fields. It means that there should be more then one, say combo boxes and every next combo's display depends on what the user've chosen in preceding combo box...
My question is: 1. should i commit and try harder to figure out how to do it in practice or 2. it is too complicated and such an interface is impossible to make easy to use and it will be better and more practical to resort to simpler solution such as make user just to type location description and it will be an end of it? 3. did you ever had such a problem and how you solved it? Best regards, Svetlana
I have designed something similar and I think you are looking right past the answer... use a simple expandable tree with selectable links. Actually, it ended up being fairly easy to implement. For an example see: DHTML Tree.
posted 16 years ago
Originally posted by Chris Mathews: I have designed something similar and I think you are looking right past the answer... use a simple expandable tree with selectable links. Actually, it ended up being fairly easy to implement. For an example see: DHTML Tree.
Mmmmm, yes, it could be it! Thank you for the pointer, Chris, i am definitely going to look into it. It would be very interesting to do something like this. I envision very big tree.
Svetlana, Something different you maight want to look at... Make a multidimensional (n dimensions) array of all the locations. e.g. the top-most dimension could consist of all the top level containers (rooms, labs etc.)...then in the next dimension keep all the next level containers (closets, refrigerators, racks etc.). In the next level keep the next lower level e.g. top-drawer, top-shelf in the rack etc. Keep as may levels as see ok for the purpose now. You can add another top-level or bottom-level to the array later. So a particular item in your inventory would be stored at say location(2,3,1,5) where the first top level (2) has the room, the next level (3) has the closet identification, the next level (1) has the drawer id within the closet and the last level (5) may be has the bottle id (assuming the top drawer has a number of bottle of different chemicals). Then you can have a sorted linked list for each member. This list would contain all the locations that this member has access to. e.g. loc(2,3,1,5), loc(2,2,3,4).....etc. You can sort this list for each member in descending order of the number of accessible locations in a room. For example, if a person has most of her items in room 3, closet 2 then the locations in room 3, closet 2 can be near the beginning in the linked list for this person so that a search would be shorter. HTH. Dinesh [ February 10, 2004: Message edited by: Dinesh Kumar ]
posted 16 years ago
Thank you Dinesh! I actually was thinking about something along the lines... You are right that some mechanism is needed to render the potentially very big tree more comprehensible and easy to use. If you've noticed, LabMemberID is added as a field to locations table. There are two categories of items naturally: lab-wide and private. Lab-wide categories I could track down by type of form the user is filling (i wanted to add linking table locationID-Categories that should be automatically updated upon addition of new forms and locations), in addition, if LabMemberID is not null, i will be able to pull all private reagents stashes for a particular user... By using the linking table i could figure out tree representation for a particular situation and for particular user. For ex. if i'm working with cell lines places where i can store them are limited to thermostats, -70 freezers and luquid nitrogen containers. Also, i was thinking about grading nodes by their position's depth as you just noted. I even wanted to include isLeaf field into the table. I hope that i can make it clear for user, whoever is creating new location, that room 206 is among the top and 4X5 cell in a pink box is a leaf. It will allow me cutting off some parts of the tree selectively i.e. not to represent obvious leaves as candidate parents later. Overall, today i still see it like rather complex and daunting project . I'm glad i asked the question. If you guys have some more to say, i'll be glad to hear... Regards, Svetlana
Good suggestions all. Another, simpler UI might be a Wizard-style interface, where the user builds the heirarchy by stepping through multiple steps. It's more work on the user, but much easier on the developer (and that's what's important, right? )
Originally posted by Neal Ford: Good suggestions all. Another, simpler UI might be a Wizard-style interface, where the user builds the heirarchy by stepping through multiple steps. It's more work on the user, but much easier on the developer (and that's what's important, right? )
Absolutely! I am almost done to make it easier on myself. Now i need strategic places to hang my principal carrots for lazy scientists to come back to nibble at. Software is all about users!!! Thank you all. I really appretiate it
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.