Exforsys

Online Training

what sort of pattern should I be looking at here.

This is a discussion on what sort of pattern should I be looking at here. within the Software Patterns forums, part of the Testing category; I am writing a system to manage batch-jobs and the hosts that run them. Currently there are about 4 ...


Go Back   Exforsys > Testing > Software Patterns

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-31-2005, 09:55 AM
Shea Martin
Guest
 
Posts: n/a
what sort of pattern should I be looking at here.

I am writing a system to manage batch-jobs and the hosts that run them.
Currently there are about 4 different types of jobs will be managed. It is
rare that new job types are introducted to the system.

The jobs use text files for settting the runtime parameters. There are 2
settings I am interested in, in these parameter files. But each job type
has a different format of parameter file. So while I am always interested
in the same two params, how I parse the parameters file depends on the job
type. These parameter files often (not always) determine the Host that the
job will run on.

The other unique aspect of the varying job types is the command used to run
the job.

All other apects of a job are the same.

In my first system design, I created on Job object, and used a constant, to
set the job type. I then implemented the getCommand() call, using switch
based on the job type, to return the appropriate string.

A method in the managing class did the parsing of the parameters files, and
set the appropriate methods in the Job objects, i.e., setRuntime(),
setMemUsage(), etc.

I am not nutz about this design.

I thought about creating an abstract Job, then inheriting from it for each
of then job types, implementing appropriate getCommand() and
getParametersFromFile().

My other idea was to use an abstract factory.

Any thoughts?

~S
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-05-2005, 07:47 AM
Saurabh Aggrawal
Guest
 
Posts: n/a
Re: what sort of pattern should I be looking at here.


Shea Martin wrote:
> I am writing a system to manage batch-jobs and the hosts that run

them.
> Currently there are about 4 different types of jobs will be managed.

It is
> rare that new job types are introducted to the system.
>
> The jobs use text files for settting the runtime parameters. There

are 2
> settings I am interested in, in these parameter files.



>But each job type has a different format of parameter file.


What does that mean, differnt format for parameter file.

> So while I am always interested
> in the same two params, how I parse the parameters file depends on

the job
> type. These parameter files often (not always) determine the Host

that the
> job will run on.
>
> The other unique aspect of the varying job types is the command used

to run
> the job.
>
> All other apects of a job are the same.
>
> In my first system design, I created on Job object, and used a

constant, to
> set the job type. I then implemented the getCommand() call, using

switch
> based on the job type, to return the appropriate string.


what string are you talking about.

>
> A method in the managing class did the parsing of the parameters

files, and
> set the appropriate methods in the Job objects, i.e., setRuntime(),
> setMemUsage(), etc.
>
> I am not nutz about this design.
>
> I thought about creating an abstract Job, then inheriting from it for

each
> of then job types, implementing appropriate getCommand() and
> getParametersFromFile().
>
> My other idea was to use an abstract factory.
>
> Any thoughts?
>
> ~S


What i can understand is that the job is selected depending on the two
parameter files and then job object selects the Host on which it should
be executed. I think you should use the Command Pattern.

Saurabh Aggrawal

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 10:11 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.