Difference between diagram EA et class diagram - database

What is the difference between EA diagram and et class diagram?
EA diagram shows how our data is stored in the database and the relationships between them. While the class diagram shows the objects that are manipulated in the system, the business classes.
In the image below, I have presented these two diagrams. Your comments are welcome.
If the class diagram highlights the objects that must be in the system, how we can specify (Employe, DG, TeamLeader) the Person class at the time of implementation known in the database we have the table Person which is linked to Role and that with the time the data of this table can be modified (add, edit).

Related

How to correctly show M:N relationship in conceptual data model?

I usually find everything I need, but there is first time for everything.. :D
I am trying to create a conceptual data model and I dont know how to properly show M:N relationship, which by default should not be included, but still you can assign verbs and directions of abstract entities. So let's say we have "Projects" and we have "Project roles", how do I properly show relationships? Can I have 2 arrows as showed in the picture or do I have to add join table and ?? I can't wrap my head around this..
Thank you so much in advance :)
enter image description here
A conceptual data (or information) model can be created with a suitable modeling language, such as ER diagrams or UML class diagrams. Both languages have a concept and a visual notation for many-to-many associations (or relationship types). Simply follow their definitions. Since there is no standard for ER diagrams, it's easier/preferable to go with UML.
For showing a many-to-many association between two classes (representing entity types), you draw a connection line and annotate it with an asterisk ("*") at both ends.
Notice that a join table is a database implementation, and not a modeling concept.

Are there any issues with my Entity Relationship diagram?

My Entity Relationship Diagram
My ER diagram designed for the Orders database about customers and their orders for
a company. Each item
in the database must have an “owning” salesman, whether or not it is being ordered.
With that being said I was wondering whether there were any issues with my diagram? What do you suggest I should change?
Should I remove the customer and salesman attributes?
I not sure but I think in your the Address Entity is extra its a attribute customer only so why you create address as a separate attribute.
Please refer the attach image to correct your different relationship with attributes.

PowerDesigner Internal Database - Relating Entities to Diagrams

I am tring to write some ETL to extract Conceptual Models, and their assoicated Diagrams and Entities, out of a powerdesigner database.
So Far, I have the querys that return:
1/ The list of Conceptual Models (based on the class name 'Conceptual Data Model').
2/ The list of Conceptual Diagrams assoicated with each Conceptual Model (based on the data in 1/ and the relationship class 'Diagrams' to the targe object class 'Conceptual Diagram').
3/ The list of entities associated with each Conceptual Model (based on the data in 1/ and the relationship class 'Entities' to the targe object class 'Entity').
My problem is that I need to understand the set of Entities, 3/ above, assoicated with each Diagram, 2/ above. There are no records in the relationship table, PMRLSH, for these.
TL;DR Does anyone know where in the powerdesigner database the set of entities contained in a conceptual diagram are stored?
This information is not directly available.
All the diagram contents (including the references toward displayed design objects) is packed as the long text (in PMTEXT, in an undocumented format) indicated by PMOBJT.BCOL.

Is there a relationship between Database Tables and Object Oriented Classes?

Every time I program I recognize this relationship between classes and tables, or am I imagining it.
You can have a class per database table or a table per class i.e. :
tables: customer, products, order.
classes: customer, products, order, may have methods such as addRecord, deleteRecord, updateRecord.
what is this called? Object-Relational? I am not a DBA.
It all depends on the type of database you're using. If you're using an object oriented database (OODB), then there is no relationship, as the objects and the persisted data are the same thing. For example, if you have a Customer class, and you save it in an OODB, then that instance of the customer is what is stored in the DB.
If you are using a relational database, then the class instances, and the persisted representation of them in the DB, can be the same thing, but many times they aren't. This is because most folks use normalization to represent their data in an efficient way (in a relational DB). This means, instead of having a table per class, you can have a class represented by more than one table. In the Customer example, the tables might now be Customer (with Name, date of birth, and other properties), and Order (with order pointing to products in yet another table). The reason for this has to do with cardinality, and the ability for Customers to have more than one order. When your business logic needs this information from the DB, the data access layer's job is to map the data (called ORM) from the DB into your classes.
If you are using yet another type of DB, then there will be a different relationship between the classes (domain model) and what's persisted in the DB.
But, as far as having a name for this relationship? No, there is no name.
In additon to Bob's answer, the following.
In object modeling, the relationship between classes and subclasses is taken care of by inheritance, and object modelers know how to use inheritance to good advantage. The relational data model and by extension the SQL databases do not implement inheritance for you. You have to design tables to give you some of the same results.
In ER (Entity-Relationship) modeling, the corresponding concept is called generalization/specialization. This tells you how to model a class/subclass relationship, but it doesn't tell you how to design the tables when you go to build your database.
There are three techniques that are pretty well understood that can be really helpful when dealing with classes and subclasses. Here are their tags: single-table-inheritance class-table-inheritance shared-primary-key. Unfortunately, many tutorials on database design never cover these techniques. They can be enormously useful to people who know object modeling and want to come up to speed on relational modeling.

What does inheritance in UML do with your ERD?

I created a class diagram for a system and now I have to model it into a real system. This means converting it to a database.
Now there is a base class which has just a few attributes, but there are many classes that inherit from it. Now my checklist for converting says I have to create a table for every class.
I don't know how to handle the inheritance, I can see that associations are done with PK and FK's but what about subclasses?
Is there some article which handles that or is there someone who can explain it to me?
Thanks in advance,
You have three alternatives to translate class hierarchies into relational tables:
- Create only a table for the superclass (all attributes and associations of subclasses are moved to the table corresponding to the superclass with the possibility of taking a NULL value)
- Create only tables for the subclasses: All attributes and associations of the superclass are repeated in each subclass
- Create tables both for the superclass and for each of the subclasses. In this case, the PK of the subclasses is at the same table a FK to the superclass (this ensures that all identifiers in a subclass table correspond to an existing identifier in the superclass table. A join between both tables allows to recover the full information of the element)
The best strategy depends on the problem (for instance, the number of attributes in each class, the number of levels in hierarchy, whether the hierarchy is disjoint or not,...)
If you want to see some examples, you can upload your hierarchy to the UMLtoDB online service http://modeling-languages.com/content/uml2db-full-code-generation-sql-scripts-databases
Drop all that UML nonsense - keep it simple. Its just amounts to duplication for no gain. Does Microsoft or Sun publish UML for dOT NET or Java... FOrgetting the odd sample, the majority of these frameworks dont have any official UML anywhere.
Usually, you design your datamodel (database tables/PK/FK etc.,) in parallel when you design your actual class diagram. After identifying all the cadidate classes and the dependencies on each of the classes, you will probably go on with the design sequence diagram. By this time, your data model should have been finalized.
I cannot understand your situation here, but IMO the process that you follow seems a bad idea to me.

Resources