Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Object based Data Models
In object based data models, the focus is on how data is represented. The data is divided into multiple entities each of which have some defining characteristics. Moreover, these data entities are connected with each other through some relationships.So, in object based data models the entities are based on real world models, and how the data is in real life. There is not as much concern over what the data is as compared to how it is visualised and connected.Some examples of object based data models areEntity Relationship Data ModelObject Oriented Data ModelSemantic Data ModelFunctional Data ModelOut of these models, ...
Read MoreComparison between E-R Model and Object Oriented Model
The detailed comparison on the E- R model and Object Oriented Model is given as follows −E-R ModelER model is used to represent real life scenarios as entities. The properties of these entities are their attributes in the ER diagram and their connections are shown in the form of relationships. An ER model is generally considered as a top down approach in data designing.An example of ER model is −Advantages of E - R modelThe data requirements are easily understandable using an E - R model as it utilises clear diagrams.The E-R model can be easily converted into a relational database.The ...
Read MoreRepresentation of class hierarchy in DBMS
Class hierarchy can be viewed one of two waysSpecialization (Top Down Approach)Generalization (Bottom Up Approach)SpecializationSpecialization is a process of identifying subsets of an entity that shares different characteristics. It breaks an entity into multiple entities from higher level (super class) to lower level (subclass). The class vehicle can be specialized into Car, Truck and Motorcycle ( Top Down Approach)Hence, vehicle is the superclass and Car, Truck, Motorcycle are subclasses. All three of these inherit attributes from vehicle. Moreover, these three share those attributes among themselves while containing some other attributes which make them different.GeneralizationGeneralization is a process of generalizing an entity which ...
Read MoreMoving Object Databases
Moving objects are those whose position changes frequently over a period of time. Conventional databases don't know how to handle this scenario, as they assume the data objects are stationaryIn this case, we use moving object databases. These databases can store information about moving objects and allow querying on them.For example- The location of nearest taxis for a particular customer can be found using querying on moving object databases.The approaches used in handling moving object databases are:Location ManagementThe current locations of the objects are saved in the database and estimations are made on their near future positions. This information is ...
Read MoreMandatory and optional Participation
Mandatory and optional participation are observed in E-R models between 2 different entities.Mandatory ParticipationIn the mandatory participation, for every instance of entity A, there must exist an instance of entity B and vice versa.An example of Mandatory participation would be relationship between mother and child. The child entity would exist only if there were a mother and similarly a mother would exist only if there were a childOptional participationIn optional participation, it is not necessary for all the instances of the entity to participate in a relationship. It may be that the number of instances participating for a particular entity ...
Read MoreWhat are the basic rules and idioms for operator overloading in C++?
When it comes to operator overloading in C++, there are 3 basic rules you should follow. like all such rules, there are so exceptions. These 3 rules are −1. Whenever the meaning of an operator is not obviously clear and undisputed, it should not be overloaded. Instead, provide a function with a well-chosen name. Basically, the first and foremost rule for overloading operators, at its very heart, says:Don’t do it.That might seem strange, but there are only a few cases where operator overloading is appropriate. The reason is, it is hard to understand the semantics behind the application of ...
Read MoreConversion of Set To Stream in Java
Being a type of Collection, we can convert a set to Stream using its stream() method. Example import java.util.HashSet; import java.util.Set; import java.util.stream.Stream; public class Tester { public static void main(String args[]) { Set<String> set = new HashSet<String>(); set.add("a"); set.add("b"); set.add("c"); set.add("d"); set.add("e"); set.add("f"); Stream<String> stream = set.stream(); stream.forEach(data->System.out.print(data+" ")); } } Output a b c d e f
Read MoreWhat is ternary operator (? X : Y) in C++?
The conditional operator (? :) is a ternary operator (it takes three operands). The conditional operator works as follows −The first operand is implicitly converted to bool. It is evaluated and all side effects are completed before continuing.If the first operand evaluates to true (1), the second operand is evaluated.If the first operand evaluates to false (0), the third operand is evaluated.The result of the conditional operator is the result of whichever operand is evaluated — the second or the third. Only one of the last two operands is evaluated in a conditional expression. The evaluation of the conditional operator ...
Read MoreCharacter Stream vs Byte Stream in Java
Byte StreamsJava byte streams are used to perform input and output of 8-bit bytes. Though there are many classes related to byte streams but the most frequently used classes are, FileInputStream and FileOutputStream. Following is an example which makes use of these two classes to copy an input file into an output file −Exampleimport java.io.*; public class CopyFile { public static void main(String args[]) throws IOException { FileInputStream in = null; FileOutputStream out = null; try { in = new ...
Read MoreChecking internet connectivity in Java
Internet connectivity can be checked using java.net.URL and java.net.URLConnection class. Following are the required steps.Create a URL object and pass it the URL say GoogleCall URL.openConnection() method to get a URLConnection object.Call URLConnection.connect() method to check the internet connectivity. connect() method opens a communications link to the resource referenced by the passed URL if a connection has not already been established.Exampleimport java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; public class Tester { public static void main(String[] args) { try { URL url = new URL("http://www.google.com"); URLConnection connection ...
Read More