logo

Java EE and MVC Design Pattern Implementation

   

Added on  2020-05-11

14 Pages2362 Words90 Views
 | 
 | 
 | 
Enterprise Software Development Question 1(1a)i.Java-Database-Connectivity ( JDBC )The java Database Connectivity is a programming application interface that is majorly used for the java language to create database applications. This determines how the user can now access the database. It is Java access technology and used for Java database connectivity. It was created by Oracle corporation to be used by Java Standard Application platform. JDBC uses JDBC drivers with connect to the database.ii.SerializationSerialization simply is a process that entails changing object of a memory to make stream of bytes in order that the stuff such as store can be on a disk or maybe send the bytes over a network.Only thing to understand now is how those stream of bytes are interpreted or manipulatedso that we get the exact same Object/ same state. There are various ways to achieve that. Some of them are - 1.XML : Convert Object to XML, transfer it over a network or store it in a file/db. Retrieve it and convert it back to the object with same state. In Java we use JAXB(Java architecture for XML binding) library.(From java 6 it comes bundled with JDK).2.JSON :Same can be done by converting the Object to JSON (Javascript Object notation). Again there is GSON library that can be used for this.3.Or we can use the Serialization that is provided by the OOP language itself. For eg. in Java you can serialize an Object my making it implement serializable interface and writing to Object Stream.
Java EE and MVC Design Pattern Implementation_1

(1b) Components contained in>1. Application client container contains Java classes and Libraries2.Web container contains JSP pages and servlets as components. 3.EJB Containers contains Enterprise bean (1c) The role of Java EE.Jave Enterprise edition is used to extend the specifications of Java SE with specification for enterprise features.Services provided by JEE1. JEE has libraries that provide the functionality that can deploy a fault-tolerant and distributed module components that are running on the application server.2.JEE provides remote method invocation (RMI)(1d) Hibernate entity manager(1e) benefits of using Object-Relational Mapping (ORM) to access data that is not possible through(JDBC). Reuse of code, under this if class library is created it generate totally separate DLL file that ORM data access code uses, the data objects will be re-used on a variety of applications. This way applications need no data access.
Java EE and MVC Design Pattern Implementation_2

Question 2 (2a)@ entity@ table ( nam ="tblPatient")public class Patient { @ Id @ GeneratedValue( strategy = GenerationType.IDENTITY) private Long idd; String Name = null; String gender = null; String dateOfBirth = null;String age = null; private Long get_Idd(){ return idd;}private void set_Idd(int idd){this.idd = idd;}private String getNam(){return Nam;}Private void setName(String Nam){this.Nam = Nam;}private String getGende() is not null{ gende.getLength(length<=6) ; return gende;}private void setGende(String gende){ this.gende = gende;}private String getdateOfBirth (){ return dateOfBirth;}
Java EE and MVC Design Pattern Implementation_3

private void setdateOfBirth (String dateOfBirth){ this. dateOfBirth = dateOfBirth;} }2b. i.@JoinColumn (name = id) in User entityii. @OneToOne (mapped by= password) UserProfile entity. 2c.In Table-per-class strategy in JPA, Each of the concrete classes gets still mapped to itsown database table. This mapping allows you to use polymorphic queries and to definerelationships to the superclass. Table-per-class has a superclass as and entity, that’s how isdifferent from mapped superclass strategy.Below is a JPA notation to implement the above strategy:@Inheritance(strategy=InheritanceType.JOINED)2d.@EntityPublic class Student(){@ManyToMany(mappedBy="course")}@EntityPublic class course(){@ManyToMany(mappedBy="Student")}
Java EE and MVC Design Pattern Implementation_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents