Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re (tilly) 1: Future of FBP

by jpm (Novice)
on Mar 01, 2002 at 01:54 UTC ( #148449=note: print w/ replies, xml ) Need Help??


in reply to Re (tilly) 1: Future of FBP
in thread Future of FBP

Here is an example of how JFBP (the Java implementation of FBP) might specify a network to read XML, parse it and throw away the result (yes it was a test):

public class ProcXML extends Network { protected void define() throws Throwable { connect(component("Read", ReadText.class), port("OUT"), component("XMLToObj", XMLToObj.class), port("IN")); connect(component("XMLToObj"), port("OUT"), component("Discard", Discard.class), port("IN")); initialize(new FileReader("c:\\com\\jpmorrsn\\eb2engine\\te +st\\data\\myXML3.txt"), component("Read"), port("SOURCE")); } public static void main(String[] argv) { new ProcXML().go(); } }

It names 3 components, and links them together using named ports. It is actually not too dissimilar from the SAX machine syntax, but your network can be as complex as you like.

XMLToObj is an XML parser I wrote that runs in the JFBP environment.

Your comment in the second para seems to suggest that you can use such a specification to link components written in different languages - I didn't know you could do that in Java. Where would I look to find out?


Comment on Re: Re (tilly) 1: Future of FBP
Download Code
Re (tilly) 3: Future of FBP
by tilly (Archbishop) on Mar 03, 2002 at 15:27 UTC
    I don't know how you would do it in Java. But if your components live in different processes that communicate through IPC, there is no reason that you can't implement each component in a different language.

    In Perl you can lift the requirement of separate processes through liberal use of the Inline module.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://148449]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-09-16 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (45 votes), past polls