Spring Design by Contract: Where to Start?

I am trying to put a "Contract" on a method call. My web application is in Spring 3.

Write custom annotations the right way. If so, then any pointers (I didn't find anything in the Spring help docs).

Should I use tools like Modern Jass, JML ...? Again, any pointers would be helpful.

thank

+3
source share
5 answers

Modern Jass-based Java contracts are one way to contract.

http://code.google.com/p/cofoja/

According to the writing of this answer, it is quite simple. Hope this improves as we continue.

+1
source

Spring EL Spring security . Spring security @PreAuthorize, < Spring 3, :

@PreAuthorize("#customerId > 0")
public Customer getCustomer(int customerId) { .. }

, , , ADMIN.

@PreAuthorize("#user.role != T(com.company.Role).ADMIN)")
public void saveUser(User user) { .. }

@Value

public Customer getCustomer(@Value("#{434}") int customerId) { .. }

.

Spring , UserDetailsService, . Spring, SpelExpressionParser .

+3

- Java Groovy ( Spring) GContracts.

GContracts Design by Contract (tm), Java, - , , - .

+1

C4J :

  • Eclipse, .
  • , .

C4J

0
source

Source: https://habr.com/ru/post/1732413/


All Articles