473,503 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do I want multidispatch or object plug-ins or something else?

Hello all,

I've got an EDI parsing application written in Python that is becoming
unwieldy to maintain. At a high level here's what it does:

1. Loops through the EDI message 1 segment at a time (think SAX XML...)
2. Once it identifies what type of transaction is being processed it
creates a "sub-parser" specifically for that transaction type
3. The sub-parser marks up the EDI into HTML and extracts a fair
number of statistics about the transactions.

Now, my sub-parser classes are polymorphic and I've used the hierarchy
to make sure I don't have repeated code in each class. HOWEVER, I'm
finding it difficult to add new statistic gathering methods because
the code is already rather complex. That leads me to think I've got
bad design.

What I _think_ I want is a way to register plug-ins that say "I work
with transactions of type X,Y,Z" and then have the sub parser string
together calls to the various plug-ins.

The "master" sub-parser would handle the basic EDI -HTML formatting
and the plug-ins would handle gathering any statistics. I currently
use introspection to figure out what segments sub-parsers are
interested in and I figure I would keep doing that in the future.

Can anyone point me to either an on-line or off-line resource I could
use for this type of thing? Are there established "plug-in patterns"
already?

Part of why I'm asking is because I don't think I even have the right
vocabulary to describe what I'm trying to do. Any pointers would be
appreciated!

Chris
--
"A little government and a little luck are necessary in life, but only
a fool trusts either of them." -- P. J. O'Rourke
Nov 9 '06 #1
0 840

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2979
by: Chris Cioffi | last post by:
I started writing this list because I wanted to have definite points to base a comparison on and as the starting point of writing something myself. After looking around, I think it would be a...
3
3391
by: Jeff Molby | last post by:
Ok, I've googled long and hard, but I can't find anything relevant on this one. I am now at the mercy of your good nature. <g> I have 3 projects in my solution: One app and 2 libraries. I am...
6
2930
by: Gary James | last post by:
This may not be a direct C# question, but since I'll be using using C# for development, I thought I'd pose the question here. I'll soon be involved in the design of a new software product that...
1
4047
by: oLiVieR CheNeSoN | last post by:
Hi, I have built a plug in to internet explorer and added a button. I would like to get the DOM object on IE with my plug in in oder to analyze the HTML object. Do you have any idea how...
9
1185
by: Rob Nicholson | last post by:
Is it possible to trap the creation of a new object and carry out other operations after it's been created? For example, if creating an object of a specific type, then add a reference to a global...
10
1354
by: schneider | last post by:
I'm looking for a way to programaticly call a method from a different object and associate the two objects at runtime. Example: Object A exist and is unknow, I want object B to be able to call a...
3
2968
by: =?Utf-8?B?QmFkaXM=?= | last post by:
I'm doing a server side automation(I know it's bad but..) and its working fine locally and when accessing it from a remote machine using web browser is was giving me this error"Retrieving the COM...
2
1585
by: FM | last post by:
Hello I'm actually trying to extend Control Center with a plug-in. I tried to add a new menu to the CC menu but i'm not able... I've add a menu to a database-object but can't do it as a simple...
4
1423
by: -Lost | last post by:
How should one write a plug-in interface? I've tossed around several ideas but rudimentary ones at best. For example: Plug-In-A -Plug-In-Proxy -Application The plug-in simply hands off its...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.