developing for something that isn't there..

Discussion in 'Java' started by Elhanan, Jan 10, 2007.

  1. Elhanan

    Elhanan Guest

    hi..

    i've been taksed to create a framework that would read a complex xml
    (do NOT say data-binding) and use the data to populate a java bean
    tree..

    problem that java bean tree has not been built yet.

    i do have a concept of what to pull from the xml, what elements to read
    in what order, what data to get from it. so i was thinking to create a
    class that does so, but for every element (or chunk of data) pulled use
    and interface to send messages about them (sorta like sax) the classes
    which willl implement said interface, will get this data and build the
    tree..

    i was thinking that the messages will not contain an xml element itself
    but rather 'convertes' as arguments.
    the converted will implement an interface, that for now will simply
    return another xml more formated. (just to see if my parsing works) but
    will be replaced with another implmentation that will create an actuall
    class.

    i don't know exactly how tdd this as i don't even know the interfaces
    of tree i just know my side, i don't even know if i'm on the right
    path..
     
    Elhanan, Jan 10, 2007
    #1
    1. Advertising

  2. Elhanan

    Daniel Pitts Guest

    Elhanan wrote:
    > hi..
    >
    > i've been taksed to create a framework that would read a complex xml
    > (do NOT say data-binding) and use the data to populate a java bean
    > tree..
    >
    > problem that java bean tree has not been built yet.
    >
    > i do have a concept of what to pull from the xml, what elements to read
    > in what order, what data to get from it. so i was thinking to create a
    > class that does so, but for every element (or chunk of data) pulled use
    > and interface to send messages about them (sorta like sax) the classes
    > which willl implement said interface, will get this data and build the
    > tree..
    >
    > i was thinking that the messages will not contain an xml element itself
    > but rather 'convertes' as arguments.
    > the converted will implement an interface, that for now will simply
    > return another xml more formated. (just to see if my parsing works) but
    > will be replaced with another implmentation that will create an actuall
    > class.
    >
    > i don't know exactly how tdd this as i don't even know the interfaces
    > of tree i just know my side, i don't even know if i'm on the right
    > path..


    Sounds like the requirements aren't complete. If you have to parse an
    XML document and produce tree, do the simple thing and create a DOM
    tree. Since you're requirements aren't more specific, there isn't
    anything you can do.

    However, I would instead insist that your task is BLOCKED by the lack
    of interfaces. And that any thing you do before hand would be a waste
    of time and money.

    Good luck,
    Daniel.
     
    Daniel Pitts, Jan 10, 2007
    #2
    1. Advertising

  3. Elhanan <> wrote:

    > i've been taksed to create a framework that would read a complex xml
    > (do NOT say data-binding) and use the data to populate a java bean
    > tree..


    My first inclination is that Spring might be able to meet your
    requirements. Have you looked at that possibility?

    --
    C. Benson Manica | I *should* know what I'm talking about - if I
    cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
     
    Christopher Benson-Manica, Jan 10, 2007
    #3
  4. Elhanan

    Paul Davis Guest

    Do you have a schema for the "complex" xml document?
    You may want to take a look at Apache's XMLBeans.

    If not, just use JDOM. You should not have to do any parsing. There are
    too many well established frameworks to do that for you.

    On to the non-existent code. If you don't have a set interfaces to
    develop to, then create the interfaces yourself and give them to the
    implementors to implement. Be sure to deliver them with some JUnit
    classes using EasyMock to verify that your code does what it should.

    Elhanan wrote:
    > hi..
    >
    > i've been taksed to create a framework that would read a complex xml
    > (do NOT say data-binding) and use the data to populate a java bean
    > tree..
    >
    > problem that java bean tree has not been built yet.
    >
    > i do have a concept of what to pull from the xml, what elements to read
    > in what order, what data to get from it. so i was thinking to create a
    > class that does so, but for every element (or chunk of data) pulled use
    > and interface to send messages about them (sorta like sax) the classes
    > which willl implement said interface, will get this data and build the
    > tree..
    >
    > i was thinking that the messages will not contain an xml element itself
    > but rather 'convertes' as arguments.
    > the converted will implement an interface, that for now will simply
    > return another xml more formated. (just to see if my parsing works) but
    > will be replaced with another implmentation that will create an actuall
    > class.
    >
    > i don't know exactly how tdd this as i don't even know the interfaces
    > of tree i just know my side, i don't even know if i'm on the right
    > path..
     
    Paul Davis, Jan 11, 2007
    #4
  5. Elhanan

    Elhanan Guest

    off course i'm not actually gonna parse it :) for this i'll be using
    xom. the interfaces aren't set becouse there getter and setters are
    being decided by the implenetors. the tree itself that is being builtg
    is highly complext and it's composed of a data java bean (where i'll
    populate) that will be contained inside a another node bean which will
    be doing all the linkng to it's fathers and sons.

    the schema for the complex xml will not reveal anything, trust me,
    there is no static data there, almost everything is being decided by an
    element's numeric attribute called TypeId.

    Paul Davis wrote:
    > Do you have a schema for the "complex" xml document?
    > You may want to take a look at Apache's XMLBeans.
    >
    > If not, just use JDOM. You should not have to do any parsing. There are
    > too many well established frameworks to do that for you.
    >
    > On to the non-existent code. If you don't have a set interfaces to
    > develop to, then create the interfaces yourself and give them to the
    > implementors to implement. Be sure to deliver them with some JUnit
    > classes using EasyMock to verify that your code does what it should.
    >
    > Elhanan wrote:
    > > hi..
    > >
    > > i've been taksed to create a framework that would read a complex xml
    > > (do NOT say data-binding) and use the data to populate a java bean
    > > tree..
    > >
    > > problem that java bean tree has not been built yet.
    > >
    > > i do have a concept of what to pull from the xml, what elements to read
    > > in what order, what data to get from it. so i was thinking to create a
    > > class that does so, but for every element (or chunk of data) pulled use
    > > and interface to send messages about them (sorta like sax) the classes
    > > which willl implement said interface, will get this data and build the
    > > tree..
    > >
    > > i was thinking that the messages will not contain an xml element itself
    > > but rather 'convertes' as arguments.
    > > the converted will implement an interface, that for now will simply
    > > return another xml more formated. (just to see if my parsing works) but
    > > will be replaced with another implmentation that will create an actuall
    > > class.
    > >
    > > i don't know exactly how tdd this as i don't even know the interfaces
    > > of tree i just know my side, i don't even know if i'm on the right
    > > path..
     
    Elhanan, Jan 11, 2007
    #5
  6. Elhanan

    Elhanan Guest

    the requirmentes are more or less complete, but we are doing things
    'xp' the tree itself is complext and althought the interfaces are sort
    of there, the guy warned that they may change, (may be even
    considrebly) so i didn't want to risk taking them out of CVS.

    parsing will be done using xom, this i allready know.

    Daniel Pitts wrote:
    > Elhanan wrote:
    > > hi..
    > >
    > > i've been taksed to create a framework that would read a complex xml
    > > (do NOT say data-binding) and use the data to populate a java bean
    > > tree..
    > >
    > > problem that java bean tree has not been built yet.
    > >
    > > i do have a concept of what to pull from the xml, what elements to read
    > > in what order, what data to get from it. so i was thinking to create a
    > > class that does so, but for every element (or chunk of data) pulled use
    > > and interface to send messages about them (sorta like sax) the classes
    > > which willl implement said interface, will get this data and build the
    > > tree..
    > >
    > > i was thinking that the messages will not contain an xml element itself
    > > but rather 'convertes' as arguments.
    > > the converted will implement an interface, that for now will simply
    > > return another xml more formated. (just to see if my parsing works) but
    > > will be replaced with another implmentation that will create an actuall
    > > class.
    > >
    > > i don't know exactly how tdd this as i don't even know the interfaces
    > > of tree i just know my side, i don't even know if i'm on the right
    > > path..

    >
    > Sounds like the requirements aren't complete. If you have to parse an
    > XML document and produce tree, do the simple thing and create a DOM
    > tree. Since you're requirements aren't more specific, there isn't
    > anything you can do.
    >
    > However, I would instead insist that your task is BLOCKED by the lack
    > of interfaces. And that any thing you do before hand would be a waste
    > of time and money.
    >
    > Good luck,
    > Daniel.
     
    Elhanan, Jan 11, 2007
    #6
  7. Elhanan

    Elhanan Guest

    how will spring asist me , (again using xom to readxml).

    Christopher Benson-Manica wrote:
    > Elhanan <> wrote:
    >
    > > i've been taksed to create a framework that would read a complex xml
    > > (do NOT say data-binding) and use the data to populate a java bean
    > > tree..

    >
    > My first inclination is that Spring might be able to meet your
    > requirements. Have you looked at that possibility?
    >
    > --
    > C. Benson Manica | I *should* know what I'm talking about - if I
    > cbmanica(at)gmail.com | don't, I need to know. Flames welcome.
     
    Elhanan, Jan 11, 2007
    #7
  8. Elhanan

    Daniel Pitts Guest

    Elhanan wrote:
    > Christopher Benson-Manica wrote:
    > > Elhanan <> wrote:
    > >
    > > > i've been taksed to create a framework that would read a complex xml
    > > > (do NOT say data-binding) and use the data to populate a java bean
    > > > tree..

    > >
    > > My first inclination is that Spring might be able to meet your
    > > requirements. Have you looked at that possibility?

    > how will spring asist me , (again using xom to readxml).
    >

    The Spring Framework can utilize a (specific) XML file to create java
    objects, and wire them together.

    Its a really neat way to implement IoC and Dependency Injection.
    Perhaps if you gave us a better idea of what the XML and bean graph is
    supposed to represent, we could suggest other alternatives.
     
    Daniel Pitts, Jan 11, 2007
    #8
  9. Elhanan

    Daniel Pitts Guest

    [Top posting corrected]
    Elhanan wrote:
    > Daniel Pitts wrote:
    > > Elhanan wrote:
    > > > hi..
    > > >
    > > > i've been taksed to create a framework that would read a complex xml
    > > > (do NOT say data-binding) and use the data to populate a java bean
    > > > tree..
    > > >
    > > > problem that java bean tree has not been built yet.
    > > >
    > > > i do have a concept of what to pull from the xml, what elements to read
    > > > in what order, what data to get from it. so i was thinking to create a
    > > > class that does so, but for every element (or chunk of data) pulled use
    > > > and interface to send messages about them (sorta like sax) the classes
    > > > which willl implement said interface, will get this data and build the
    > > > tree..
    > > >
    > > > i was thinking that the messages will not contain an xml element itself
    > > > but rather 'convertes' as arguments.
    > > > the converted will implement an interface, that for now will simply
    > > > return another xml more formated. (just to see if my parsing works) but
    > > > will be replaced with another implmentation that will create an actuall
    > > > class.
    > > >
    > > > i don't know exactly how tdd this as i don't even know the interfaces
    > > > of tree i just know my side, i don't even know if i'm on the right
    > > > path..

    > >
    > > Sounds like the requirements aren't complete. If you have to parse an
    > > XML document and produce tree, do the simple thing and create a DOM
    > > tree. Since you're requirements aren't more specific, there isn't
    > > anything you can do.
    > >
    > > However, I would instead insist that your task is BLOCKED by the lack
    > > of interfaces. And that any thing you do before hand would be a waste
    > > of time and money.
    > >
    > > Good luck,
    > > Daniel.

    > the requirmentes are more or less complete, but we are doing things
    > 'xp' the tree itself is complext and althought the interfaces are sort
    > of there, the guy warned that they may change, (may be even
    > considrebly) so i didn't want to risk taking them out of CVS.
    >
    > parsing will be done using xom, this i allready know.
    >


    Please don't top post

    Well, the the XP approach would be that you are all pair programming on
    the same aspect, rather than all working on seperate aspects. If the
    implementors can't give you a fixed interface, then you should do your
    best with what the current interface is, and change it as needed. Its
    okay if your code breaks because of their change, just be prepared to
    update.

    I have to say, from the window you've provided, I'm glad I don't work
    at your shop. Sounds like a buzz-word-abuse orgy over there. "Lets
    use JavaBeans, XML and Extreme Programming!" "Okay, what are we
    making?" "Uh, User Stories?" "..."

    <http://www.thedailywtf.com/>
    Find a non-WTF job. :)
     
    Daniel Pitts, Jan 11, 2007
    #9
  10. Elhanan

    Elhanan Guest

    but spring's DI is meant to be for services not data, i could use it to
    wire services that will read the xml , but anything else.
    let me give you an example of the xml i'm dealign with:

    <Result>
    <CaseObject TypeId=23 Id=1>
    <CaseAttribute TypeID=12>
    <CaseAttributeValue Value="Elhanan"/>
    </CaseAttribute
    <... lots more case Attributes
    </CaseObject>
    <. lots more case Objects elements

    <CaseRisk TypeID=113 id=0101>
    <ResultRIsk TypeId =32 id=3>
    <CaseAttributreResult ....>
    2-3 attributes depedning on the TypeId
    </ResultRisk>
    </CaseRisk>
    <CaseRelation To=0101 From=1/>
    lots more caseRelations
    <?Result>

    so basically i would need to map each CaseRisk, read it's results, jump
    to it's relation, from there jump to it's CaseObject, read that as
    well, place each CaseRIsk and caseObject into a cohesive class and also
    place the CaseRisk into a tree (becouse although they are not nested in
    the xml, the collection of the caseRisk has a logical grouping of a
    tree).

    btw while searching for this thread to answer, i cam across this:
    http://www.ivalidator.org/ivalidator/en/index.html;jsessionid=2anmsm4sjjs4d

    could it help me test these things?


    Daniel Pitts wrote:
    > Elhanan wrote:
    > > Christopher Benson-Manica wrote:
    > > > Elhanan <> wrote:
    > > >
    > > > > i've been taksed to create a framework that would read a complex xml
    > > > > (do NOT say data-binding) and use the data to populate a java bean
    > > > > tree..
    > > >
    > > > My first inclination is that Spring might be able to meet your
    > > > requirements. Have you looked at that possibility?

    > > how will spring asist me , (again using xom to readxml).
    > >

    > The Spring Framework can utilize a (specific) XML file to create java
    > objects, and wire them together.
    >
    > Its a really neat way to implement IoC and Dependency Injection.
    > Perhaps if you gave us a better idea of what the XML and bean graph is
    > supposed to represent, we could suggest other alternatives.
     
    Elhanan, Jan 11, 2007
    #10
  11. Elhanan

    Lew Guest

    Elhanan wrote:
    > top-posted


    Please, please stop top-posting.

    - Lew
     
    Lew, Jan 11, 2007
    #11
  12. Elhanan

    Elhanan Guest

    untill today i never even heard the term top-posting, what's that?
    Lew wrote:
    > Elhanan wrote:
    > > top-posted

    >
    > Please, please stop top-posting.
    >
    > - Lew
     
    Elhanan, Jan 12, 2007
    #12
  13. Elhanan

    Elhanan Guest

    still don't know what is top-posting, i'm simply repling to each
    indvidual's post, if i try to reply to everyone at the same post that
    would be a mess

    xml was chosen becouse well. that's what the product gives us :), we
    didn't have a choice.

    creating a tree model of javabeans was my insisting becouse i didnt'
    want to directly access the xml and do buisness logic on it (i was
    burned and actually still burning, becouse the product's last version
    had a complelty differnt strucutre and style of interface, like fixed
    lengh strings stuff), so i wanted to create a buisness abstraction of
    the xml, based the user requriments, problem the users themsevles can't
    tell how to process the xml and extract the relavent bits from it,
    (technically i know to process the xml, and know it's structure, but
    it's laced with heavy buisness meaning which i cannot determine
    myself).


    i agree are not using full xp here, first of all we are not fully
    implenting pair programing (managment wouldn't allow it), managment
    also insisted that analsys would be completed by the users (it's not
    yet completed, but it's 100 page growing), we don't have pure TDD
    (becouse pesonally i cannot bring myself to write something that won't
    complie, i have morbid fear that would mess up eclipse somehow if i
    continue to run stuff that partialy complie).
    but we do have 2 week intervals, only the contents of what would be
    accmplisehd in these 2 weeks was pre-deterined becouse we had the
    analasys, and we either remove stuff during the 2 weeks we think won't
    be done in time and divide it for each person in the team, we do sit
    with the users for a 3-4 hours meeting in the begning the 2 weeks,
    showing what was done, and what will be done ,and we do hold a standup
    meeting every morning, to update each other's progress. the company's
    java (in application developemtn ,not infrastructure) is very little,
    and this is first time xp is implemented here.


    and from my own persperctive, my last job was get this file , load it
    to oracle, turn it to excel, and had over the report, move files from
    here to there, import files, export files, almost pure IT, for 8 years
    i've been doing this sorta thing, and i feel i'm sooo behind other
    folks who actually did real development,i thought that's all i'm good
    for and would never get a job at anything, i'm REALLY happy getting
    this job, and getting actuall exprience in java development, i may
    never be able to catch up others, but at least it's a step up.



    Daniel Pitts wrote:
    > [Top posting corrected]
    > Elhanan wrote:
    > > Daniel Pitts wrote:
    > > > Elhanan wrote:
    > > > > hi..
    > > > >
    > > > > i've been taksed to create a framework that would read a complex xml
    > > > > (do NOT say data-binding) and use the data to populate a java bean
    > > > > tree..
    > > > >
    > > > > problem that java bean tree has not been built yet.
    > > > >
    > > > > i do have a concept of what to pull from the xml, what elements to read
    > > > > in what order, what data to get from it. so i was thinking to create a
    > > > > class that does so, but for every element (or chunk of data) pulled use
    > > > > and interface to send messages about them (sorta like sax) the classes
    > > > > which willl implement said interface, will get this data and build the
    > > > > tree..
    > > > >
    > > > > i was thinking that the messages will not contain an xml element itself
    > > > > but rather 'convertes' as arguments.
    > > > > the converted will implement an interface, that for now will simply
    > > > > return another xml more formated. (just to see if my parsing works) but
    > > > > will be replaced with another implmentation that will create an actuall
    > > > > class.
    > > > >
    > > > > i don't know exactly how tdd this as i don't even know the interfaces
    > > > > of tree i just know my side, i don't even know if i'm on the right
    > > > > path..
    > > >
    > > > Sounds like the requirements aren't complete. If you have to parse an
    > > > XML document and produce tree, do the simple thing and create a DOM
    > > > tree. Since you're requirements aren't more specific, there isn't
    > > > anything you can do.
    > > >
    > > > However, I would instead insist that your task is BLOCKED by the lack
    > > > of interfaces. And that any thing you do before hand would be a waste
    > > > of time and money.
    > > >
    > > > Good luck,
    > > > Daniel.

    > > the requirmentes are more or less complete, but we are doing things
    > > 'xp' the tree itself is complext and althought the interfaces are sort
    > > of there, the guy warned that they may change, (may be even
    > > considrebly) so i didn't want to risk taking them out of CVS.
    > >
    > > parsing will be done using xom, this i allready know.
    > >

    >
    > Please don't top post
    >
    > Well, the the XP approach would be that you are all pair programming on
    > the same aspect, rather than all working on seperate aspects. If the
    > implementors can't give you a fixed interface, then you should do your
    > best with what the current interface is, and change it as needed. Its
    > okay if your code breaks because of their change, just be prepared to
    > update.
    >
    > I have to say, from the window you've provided, I'm glad I don't work
    > at your shop. Sounds like a buzz-word-abuse orgy over there. "Lets
    > use JavaBeans, XML and Extreme Programming!" "Okay, what are we
    > making?" "Uh, User Stories?" "..."
    >
    > <http://www.thedailywtf.com/>
    > Find a non-WTF job. :)
     
    Elhanan, Jan 12, 2007
    #13
  14. Elhanan

    Ian Wilson Guest

    Elhanan wrote:
    > still don't know what is top-posting


    A: In written English, conversations flow from the top.
    Q: Why?
    A: It is harder to read.
    Q: What is wrong with that?
    A: It's when you put your reply above the original.
    Q: What is top-posting?

    In which order did you read the above?
    In what order should I have written it?
     
    Ian Wilson, Jan 12, 2007
    #14
  15. Elhanan

    Ian Wilson Guest

    Elhanan wrote:
    > untill today i never even heard the term top-posting, what's that?
    > Lew wrote:
    >
    >>Elhanan wrote:
    >> > top-posted

    >>
    >>Please, please stop top-posting.
    >>


    http://en.wikipedia.org/wiki/Top-post
     
    Ian Wilson, Jan 12, 2007
    #15
  16. Elhanan

    Elhanan Guest

    so basically you just want me to delete the rest of the message except
    my immidiate comment?
     
    Elhanan, Jan 12, 2007
    #16
  17. Elhanan

    Ian Wilson Guest

    Elhanan wrote:
    > so basically you just want me to delete the rest of the message except
    > my immidiate comment?


    I mentioned <http://en.wikipedia.org/wiki/Top-post>. To put it simply.
    Newsgroups are different from email. A person elsewhere on the plane
    might read your reply before my posting reaches them. It is also useful
    for a newsgroup posting to make sense in it's own right without forcing
    the reader to read tens or hundreds of preceding messages in order to
    make sense of the reply.

    Therefore it is accepted practise in many newsgroups (this inlcuded) to

    - Quote the original message to which you are replying.
    - Trim out any parts of the quotation which are not relevant.
    - Type your reply *below* the quoted part, not at the *top*.

    If you are commenting to several parts of a message then interleave your
    replies with the quoted parts.

    This makes it easier to read, since English conversations are written
    from top to bottom. not the other way around.

    Of course it is only a convention, you can do what you want.

    If you want more people to read your messages and reply to you with
    help, I believe you'll find it more effective to fit in with polite
    conventions than to deliberately annoy people. Your choice.
     
    Ian Wilson, Jan 12, 2007
    #17
  18. Elhanan

    Lew Guest

    Elhanan wrote:
    >> so basically you just want me to delete the rest of the message except
    >> my immidiate comment?


    Ian Wilson wrote:
    > I mentioned <http://en.wikipedia.org/wiki/Top-post>.


    The explanation cited by Ian seems crystal clear to me. It may be the clearest
    succinct explanation of top- (and other-) posting and its social impact I've
    seen yet.

    The practice on this group is "interleaved posting".

    - Lew
     
    Lew, Jan 13, 2007
    #18
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. milkyway
    Replies:
    1
    Views:
    384
    Collin VanDyck
    Dec 2, 2004
  2. Michael Strorm
    Replies:
    19
    Views:
    561
    Michael Strorm
    Apr 20, 2005
  3. SB
    Replies:
    6
    Views:
    332
    Old Wolf
    Apr 23, 2004
  4. Bart Nessux
    Replies:
    3
    Views:
    278
    Bart Nessux
    Jan 23, 2004
  5. levon
    Replies:
    1
    Views:
    138
    Tony Bukres
    Jun 27, 2005
Loading...

Share This Page