Re: Half user config and half client prog implemented
- From: "topmind" <topmind@xxxxxxxxxxxxxxxx>
- Date: 27 Nov 2006 12:44:28 -0800
visionset wrote:
I have a Leave type that represents a kind of employee leave (eg holiday,
sick etc)
The app I'm writing may end up at any company, so I need to have the leave
types configurable throught the app. I'll do this for simple types that
just require a unique labeling. But other types maybe more complex and
require some bespoke algorithm on a per company basis. So I'll implement an
interface for each of these special types.
I'm using Hibernate for the ORM.
I'm thinking at the moment to have a persisted PLeaveType with a ClassName
attribute so that this base persisted type may be wrapped by the Class
denoted. Usually in the case of the user configured simple leave this will
be just some generic implementation. But with the special types there will
be a specific class to instantiate.
Does this sound like a decent plan?
--
Mike W
Mike, My experience is that it is nearly impossible to know what
different companies will want ahead of time. I wouldn't be overly
concerned with such because it is an impossible task to make the parts
all plug-swappable. The granularity of differences will often be
smaller than your modules. Thus, either you make gajillion small
modules (which is ugly), or duplicate most of the code in a module for
minor differences.
Keep things like company names in a config file of some kind, but leave
it at that. You will need to custom-tweak the code per different
company. That is unless you can dictate to them the limits, like a
subscription-based web service. But things like holiday calculations
will vary widely. Maybe put holidays in a database table and let each
company fill in the table as needed for their company. Their "holiday
types" may vary also. One-size-fits-all generic classifications are
also usually a dead-end goal. I would try to view holidays as having
sets of orthogonal features (sets) rather than types. Features are more
scalable and avoid either-or traps that typing can get you into. But
this depends on how fancy holiday designation needs to be.
-T-
.
- References:
- Half user config and half client prog implemented
- From: visionset
- Half user config and half client prog implemented
- Prev by Date: Re: Half user config and half client prog implemented
- Next by Date: Re: Pattern Question
- Previous by thread: Re: Half user config and half client prog implemented
- Next by thread: Pattern Question
- Index(es):
Relevant Pages
|