The code is so split up that it is hard to provide a sample
For instance
Credit card Validator class
Card number generator class
CardType class
CardState class
Credit card vaidator has 4 public static functions
boolean validate(String raw)
String stripDelimiters(String raw)
String returnCheck(String raw)
int returnCheck(int raw)
-----Original Message-----
From: Jacek Laskowski [mailto:[EMAIL PROTECTED]
Sent: 26 March 2004 10:02
To: [EMAIL PROTECTED]
Subject: Re: [openejb-user] Just a question.
Michael Forster wrote:
> I have inherited a load of beans and other class files from a previous
> developer now he has done some strange things which I just would like to
> make sure I understand what he is/was doing.
>
> Most of his functions (sorry All) of his functions in non ejb files are
set
> to public static This means that you don't need to create an instance of
> the class to access the function which means he was not using proper OOP
> techniques, suggesting he was not doing things in the correct manner.
>
> I would be better creating an instance of the class and then using the
> functions in the correct manner? What are peoples views on this - I can
see
> how it has made it quicker to call utility functions but the correct way
> should be to instantiate a class and call the functions from there?
Hey,
It mostly depends on what the static operations have to do. If they
don't use any instance variables (e.g via getters, setters) they're
utilities and thus static. Although it's not seems to be OO-approach by
some I don't see any other way to sort it out other than declaring them
as 'public static'.
Show us a sample method with its accompanying class and we'll discuss it
in the detail.
> Michael Forster
Jacek
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.620 / Virus Database: 399 - Release Date: 11/03/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.620 / Virus Database: 399 - Release Date: 11/03/2004