troubleshooting Question

Java-Sybase design help and advise please...

Avatar of irodov
irodov asked on
Java
5 Comments1 Solution230 ViewsLast Modified:
Experts -
I have a design question..
I have an application where core api is in Java and interacts with sybase at backend..

In several requirements, we need to enhance our code to include Sybase cols as for example:

Calculaiton Method can be of many types for examples:
NOE
Simple etc.
and based on the fields we get from sybase DB, we apply appropriate calculation method to our calculations..

Now there are 2 ways to achieve this req..
1). we enhance to include col in table which has int in sybase --
NOE= 1, Simple = 2,  etc and then from java -- we get 1,2 or 3 and based on this we pick the appropriate class to apply calculation method..
downside -- we need to remember that NOE =1 , Simple =2, maintain in Constants class or somewhere and always refer to that if we forget or even preparing a report say for example ..
in sybase, we need to pick all the rows which are set for NOE .. Now we will need to pick all rows where calculation method = 1 and then in excel change to NOE to send to business correct?

Good thing in this approach  is -- better performance since we are just storing int's in sybase..

other way of doing this..

in sybase -- add a col (varchar) which stores NOE, Simple  (exact strings).. and based on strings apply the calculation method --
downside - I guess it will not perform so good compare to 1..
good thing -- more descriptive, easy in case of prod suppport or report prepartion..

Similarly we have req for precisions --
currently we have only one col of precision where we store:
-1 means 1 Truncate
1 means 1 Round

But now we have to start storing --
precision value and precision type
where precision value = 1,2,3....
precision type = ROUND, TRUNCATE, ROUND_UP, ROUND_TO_NEAREST_WHOLE_NUMBER etc...

so Not sure what should be the best way to achieve this..

Please advise ideas or alternate suggestions of what is the best way of doing this..
thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros