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
ASKER CERTIFIED SOLUTION
Mayank S
Principal Technologist

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 5 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 5 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004