Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, John.

Asked: November 01, 2016 - 8:58 am UTC

Last updated: November 02, 2016 - 12:59 am UTC

Version: 11g

Viewed 1000+ times

You Asked

Hi there,

please pointed me into the right direction. I have recently been assigened a small project - is to do with cateloging historical insurance complaints that filed by customers. my background is more to Java and have basic undestanding toward the oracle database.

Am using Use Case Driven Object Modeling with UML - a process took me to the use cases designs, activity diagram, squence diagram, to indentify business model to data model; then entities in JPA; Relationship between the entities will be pretty much defined really clear depends how the entities intereact to each other and how the data/ process peform it transactions.

Frontend is using spring MVC and JPA + Hibernate, DOA layer connected to the database views abstructure layer that return views select * from table while rowstatus = 1. All the entities are connected to views, these return all the valid records.

now, a new admin functionality are needing to see both active (rowstatus =1) and the logical delete records too.
We have 2 choices:-
1. Add another view that select * from table without rowstatus cause or
2. select direct to the table

thoughts?


and Connor said...

Use a view.

I like the idea that "nothing" ever sees the table directly. It becomes a nice layer of abstraction much like the same way we do in the application tier.

One day, the data you need to provide might be a *join* of two tables-the view could do that without the app needing changes. Or you might need to redact/mask some data...the view could do that.

Even without ORM's and the like, a view in front of tables is a good idea.

Is this answer out of date? If it is, please let us know via a Comment