Super-type/Sub-type in Software Engineering [closed] - erd

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Is super-type and subtype relation exists between two entities in (ERD)software Engineering. Actually I was confused it with DBMS, because as I know that in Data Base this relation exists between two or more entities (ERD).

In Information Engineering Methodology, the concept of type/subtype exists. It is represented in ERD as in this example:
In database there are different ways to implement the type/subtype concept for example:
You could have a table with a discriminating column and include all unique columns of the 2 types. You'd have to specify subtype columns as Null in this case because they are expected to be mutually exclusive in any one given row. An example of a discriminating column for the above example may be: IsStudent (Yes/No).
You could have a base type table with 1-1 optional association (relationship) to each sub type.
Each of the above approaches have its own benefits and drawbacks.

Related

R: filtering columns and creating a new table with the outcome [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am unfortunately a beginner and would like to ask if any of you have an idea to solve my problem.
It is about a table with club members with the following columns: Name, Address, Postcode, City. Some of these members are married or live at the same address for other reasons. I need to send invitations and those who live at the same address should receive only one common invitation.
I need commands that create a table with the same columns again, but with the names with the same address in a common cell. Is something like this possible? See the picture below for better understanding.
Thank you very much for your help!
Picture: from how it is now to how it should look like afterwards
Aggregate with the paste function, roughly:
aggregate(df$name, by=list(df$address), FUN=paste)

Best practice for functions accepting key value pairs as arguments in R? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Some languages have an obvious choice when writing a function that accepts key value pairs and determining which data structure ought to be used (e.g. a hash would be an obvious option in ruby, for example).
In R, there are a few ways that come to mind. Examples:
as a named list
as a standard list
as a named vector
as a character vector with some regular expression to extubate the key and value from a single string
Is there any one data structure that is recommended over the others or is considered 'best practice'? Or does it totally depend on the use case? E.g. named anything (vector, list) will create limitations (since names have various constraints). Lists tend to be more tricky to traverse than data.frames. Parsing character vectors could have unintended consequences if the inputs aren't in a very well understood and consistent format. Etc.
Is there a dominant convention that overcomes each of these issues, or is it simply a matter of selecting the best tool for each unique circumstance?

Is it good practice to reuse the id in other routes? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I wanted to know if it is good practice to reuse the id generated in other routes, I am saving in the node employee, then this same id I reuse it in the settlements/settlement and settelement/regLiquidacion node, I keep them with the same id to then look for it faster, to delete, update, do you want to know if it is good practice to reuse the id?
my first node where I have the user
employees
-KwvdJ8uT-AoKKDFvUly
name: luis
rut: 111111
then reuse its id in the other nodes, in order to maintain an order and quick access to the data spread over other nodes
settlements/regLiquidaciones
-KwvdJ8uT-AoKKDFvUly
status: true
date: date
settlements/liquidaciones
-KwvdJ8uT-AoKKDFvUly
montoLiquido: 90000
montoBruto:900090
Yes, this is a very common pattern and generally encouraged. As you said, by using the employee ID as part of the path for the employees settlements, you can deterministically construct the path to that data and read without first querying.
Looking up by query should be as fast as by id because each field is indexed automatically.
Reusing the id probably bring you only harder-to-read source code.

Why use a molten dataframe instead of a cast dataframe (or vice versa) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
We were going over dataframes in my statistics class today, and my instructor told us about a 'molten' type and a 'cast' type. I understand what the differences are and how to convert between the two - but why would I do this? What, if anything, makes one of them more/less useful than the other? Are there specific cases where one would be preferable to the other?
My instructor told us that "we would know when we needed to use one or the other just by looking at it"... But I have no idea what I'm even looking for. A google search for "molten vs cast in R" gave me all sorts of helpful links for if I needed to know how to do it, but not why one is preferred to the other.
In addition to modeling, I have found that long datasets can be helpful with plotting varying levels. When I am doing analysis and typically need data as 1 row per observation, I re-work my data to be wide.
In the end, there isn't a precise answer, but the beauty of packages like reshape2 is that you beat your data into whatever form you need.

what does the term rep-invariant and rep ok means? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I heard this a lot when talking about software engineering and abstract data types, what does this do? Can anyone give me a concrete example of this concept?
A representation invariant is a condition concerning the state of an object. The condition can always be assumed to be true for a given object, and operations are required not to violate it.
In a Deck class, a representation invariant might be that there are always 52 Cards in the deck. A shuffle() operation is thus guaranteed not to drop any cards on the floor. Which in turn means that someone calling shuffle(), or indeed any other operation, does not need to check the number of cards before and after: they are guaranteed that it will always be 52.

Resources