Using assertions in the code.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using assertions in the code.

Jeff Prickett

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/
Reply | Threaded
Open this post in threaded view
|

Re: Using assertions in the code.

Adrian Crum-3
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
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Using assertions in the code.

Jeff Prickett

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  
<[hidden email]> 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/