|
Hi, Pavitra Subramaniam wrote: Agreed that this data isn't currently available anywhere. Getting the parents and children sounds like a treeModel to me, so I'm not sure I understand why they can't just be implementations of the treeModel. Why can't you implement a treeModel if you're using xml, etc? I don't know about DataSets, but when I look at your proposal below it looks a lot like the treeModel api, so I'm not sure why it's an improvement.- Having a TrainModel that makes no assumptions about the underlying data structure of the train data, makes it convenient for consumers that don't necessarily use the TreeModel. For instance, if I represent my train metadata using DataSets (or SDO for that matter) or some XML metadata structure, then all the consumer of the TrainModel needs to do is provide a list a train nodes for every level, and ability to go the parent or sublevel of the train, get the current node (or focusRowKey). I think in the end they are going to end up with something suspiciously like the tree model.For instance, if I had a TrainModel like below, the consumer who uses MenuModel to define their train metadata would create a MenuTrainModel implementation that internally uses the ProcessMenuModel. And the consumer who uses a custom XML structure or a DataObject to represent their train metadata, will define a XmlTrainModel, or DataSetTrainModel and internally use their own data structures to serve up information to the train. The APIs below are by no means complete, it's just an example. You are extending DataModel below, so you have to implement all of: public abstract int getRowCount() { }
public abstract java.lang.Object getRowData() { }
public abstract int getRowIndex() { }
public abstract java.lang.Object getWrappedData() { }
public abstract boolean isRowAvailable() { }
public abstract void setRowIndex(int p1) { }
public abstract void setWrappedData(java.lang.Object p1) { }
As for the rest you've swapped the word "Node" for "Row", but you've
basically renamed many of the methods on TreeModel and collectionModel.
isn't this just like isContainer on TreeModel?isn't this just like enterContainer on TreeModel?// Enter the subTrain if the current train is a container of another train public abstract void enterSubTrain(); isn't this just like exitContainer on TreeModel?// Leave the subTrain to return to the parent train level public abstract void exitSubTrain(); isn't this just like getContainerRowKey(Object childRowKey) on TreeModel// public abstract Object getParentNode(Object childNode); isn't this just like getRowCount on DataModel, which you're already extending?// gets the number of nodes at a level public abstract int getNodeCount(); isn't this just like getRowData() on DataModel, which you're already extending?// gets the rowData public abstract Object getNode(Object key); isn't this just like getRowKey() on CollectionModel?// gets the node key. Key identifies a node uniquely public abstract Object getNodeKey (); There's nothing in the current model that says anything about view id's and I don't think there should be. You should be able to write a train without navigating to a different viewId. But I'm confused why viewId is on here? Aren't you still using a command child, outcomes, and jsf navigation?public abstract Object getViewId (); Is there a focusPath method? Is there a setRowKey method? So maybe I'm not understanding this, but in general so far it seems like it's renaming methods, plus one viewId method that I don't understand. So I would assume you're going to say it has fewer methods, can you point to specific methods on menuModel that are a burden to implement? In some cases, like isSortable, or getSortCriteria it's kinda weird, but it seems like you're reinventing tree model for the most part, which doesn't seem all that useful.} - Finally, in combination with the rowData interface or the autoBind feature, they can provide custom implementations for behavior of states (visited/selected/disabled) etc. - What do you think? Again, maybe I'm not understanding the problem.... Thanks, Gab |
- Re: [Proposal] ProcessModel changes Simon Lessard
- Re: [Proposal] ProcessModel changes Arjuna Wijeyekoon
- Re: [Proposal] ProcessModel changes Simon Lessard
- Re: [Proposal] ProcessModel changes Arjuna Wijeyekoon
- Re: [Proposal] ProcessModel changes Simon Lessard
- Re: [Proposal] ProcessModel changes Arjuna Wijeyekoon
- Re: [Proposal] ProcessModel changes Simon Lessard
- RE: [Proposal] ProcessModel changes Pavitra Subramaniam
- Re: [Proposal] ProcessModel changes Gabrielle Crawford
- RE: [Proposal] ProcessModel changes Pavitra Subramaniam
- Re: [Proposal] ProcessModel changes Gabrielle Crawford
- RE: [Proposal] ProcessModel changes Pavitra Subramaniam
- RE: [Proposal] ProcessModel changes Pavitra Subramaniam
- Re: [Proposal] ProcessModel changes Gabrielle Crawford
- Re: [Proposal] ProcessModel changes Gabrielle Crawford
