> For the complete documentation index, see [llms.txt](https://admincode.gitbook.io/admincode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://admincode.gitbook.io/admincode/basics/newpage/step-2-creating-the-bussiness-object.md).

# Step 2: Creating the Bussiness Object

In this step, you'll create a Business Object class that encapsulates the business logic for interacting with your model and performs basic CRUD (Create, Read, Update, Delete) operations. This class will serve as an intermediary between the **service** and the **repository** layer.

Here’s how to create the Business Object class in your Java backend application:

1. **Create the Business Object Class**: Create a new class, inside package `bussinessobject`, that will define methods for handling CRUD operations and bussiness logic.

```java
package com.rce.businessobject;

import java.util.List;

import org.springframework.stereotype.Component;

import com.rce.businessobject.core.BaseBO;
import com.rce.exception.ValidationException;
import com.rce.model.Article;
import com.rce.model.ArticleType;
import com.rce.model.ArticleTypeEnum;
import com.rce.model.BaseO;

@Component
public class ArticleBO extends BaseBO {

	@Override
	public BaseO load(long id) {
		return super.loadBaseO(id, Article.class);
	}

	@Override
	public List<BaseO> loadAll() {
		return super.load(Article.class);
	}

	@Override
	public void save(BaseO baseO) throws Exception {
		super.saveBaseO(baseO);		
	}
	
	@Override
	public void saveAll(List<BaseO> baseOs) throws Exception {
		super.saveAllBaseO(baseOs);
	}

	@Override
	public void validateOnSave(BaseO baseO) throws Exception {
		Article article = (Article)baseO;
		if (article.getAuthor() == null)
			throw new ValidationException("Author is empty!");
		if (article.getCategory()== null)
			throw new ValidationException("Category is empty!");		
	}

	@Override
	public void delete(BaseO baseO) throws Exception {
		super.deleteBaseO(baseO);
		
	}

	@Override
	public void validateOnDelete(BaseO baseO) throws Exception {
		// TODO Auto-generated method stub
		
	}
}
```
