developing for something that isn't there..

E

Elhanan

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..
 
D

Daniel Pitts

Elhanan said:
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.
 
C

Christopher Benson-Manica

Elhanan said:
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?
 
P

Paul Davis

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.
 
E

Elhanan

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.
 
E

Elhanan

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.
 
D

Daniel Pitts

Elhanan said:
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.
 
D

Daniel Pitts

[Top posting corrected]
Elhanan said:
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. :)
 
E

Elhanan

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?
 
E

Elhanan

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 said:
[Top posting corrected]
Elhanan said:
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. :)
 
I

Ian Wilson

Elhanan said:
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?
 
E

Elhanan

so basically you just want me to delete the rest of the message except
my immidiate comment?
 
I

Ian Wilson

Elhanan said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top