You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Jeff Prickett <kg...@gmail.com> on 2014/12/30 04:21:46 UTC

Using assertions in the code.

Hi...

I just wanted to ask a quick question. I am researching the codebase and  
do not see any use of assertions in the code (ie the use of the java  
keyword assert). Is this by design because using assertions are not  
advisable in this type of server side environment or simply because they  
have not been utilized by the development team?

I may have a patch for the codebase but it would utilize assert. Of course  
I could always write a version of the patch that does not utilize assert  
but I think the code may come out cleaner and easier to understand if I  
used assert and the usage of assert would be appropriate.

Thanks in advance for your help. Also, is there an irc or chat where ofbiz  
developers congregate?

Thanks again,
Jeff


-- 
Using Opera's mail client: http://www.opera.com/mail/

Re: Using assertions in the code.

Posted by Jeff Prickett <kg...@gmail.com>.
Thanks Adrian,

I really have not programmed in a number of years and am just now finding  
the time to get back into it so I dont know what the current best  
practices are.

Jeff

On Mon, 29 Dec 2014 22:59:01 -0500, Adrian Crum  
<ad...@sandglass-software.com> wrote:

> OFBiz has the org.ofbiz.base.util.Assert class.
>
> Use of assertions depends on the developer - some find them useful,  
> others don't. As far as I know there is no best practice defined for  
> their use.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 12/30/2014 3:21 AM, Jeff Prickett wrote:
>>
>> Hi...
>>
>> I just wanted to ask a quick question. I am researching the codebase and
>> do not see any use of assertions in the code (ie the use of the java
>> keyword assert). Is this by design because using assertions are not
>> advisable in this type of server side environment or simply because they
>> have not been utilized by the development team?
>>
>> I may have a patch for the codebase but it would utilize assert. Of
>> course I could always write a version of the patch that does not utilize
>> assert but I think the code may come out cleaner and easier to
>> understand if I used assert and the usage of assert would be  
>> appropriate.
>>
>> Thanks in advance for your help. Also, is there an irc or chat where
>> ofbiz developers congregate?
>>
>> Thanks again,
>> Jeff
>>
>>


-- 
Using Opera's mail client: http://www.opera.com/mail/

Re: Using assertions in the code.

Posted by Adrian Crum <ad...@sandglass-software.com>.
OFBiz has the org.ofbiz.base.util.Assert class.

Use of assertions depends on the developer - some find them useful, 
others don't. As far as I know there is no best practice defined for 
their use.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 12/30/2014 3:21 AM, Jeff Prickett wrote:
>
> Hi...
>
> I just wanted to ask a quick question. I am researching the codebase and
> do not see any use of assertions in the code (ie the use of the java
> keyword assert). Is this by design because using assertions are not
> advisable in this type of server side environment or simply because they
> have not been utilized by the development team?
>
> I may have a patch for the codebase but it would utilize assert. Of
> course I could always write a version of the patch that does not utilize
> assert but I think the code may come out cleaner and easier to
> understand if I used assert and the usage of assert would be appropriate.
>
> Thanks in advance for your help. Also, is there an irc or chat where
> ofbiz developers congregate?
>
> Thanks again,
> Jeff
>
>