{"id":3887,"date":"2013-03-08T09:34:14","date_gmt":"2013-03-08T14:34:14","guid":{"rendered":"https:\/\/pitss.org\/us\/2013\/03\/08\/the-role-of-entity-object-view-object-and-application-module-implementation-classes\/"},"modified":"2017-05-15T14:36:39","modified_gmt":"2017-05-15T18:36:39","slug":"the-role-of-entity-object-view-object-and-application-module-implementation-classes","status":"publish","type":"post","link":"https:\/\/pitss.org\/us\/2013\/03\/08\/the-role-of-entity-object-view-object-and-application-module-implementation-classes\/","title":{"rendered":"The Role of Entity Object, View Object, and Application Module Implementation classes"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><span style=\"font-family: Arial\"><strong>If you are new to JDeveloper and ADF, then it is <span style=\"vertical-align: baseline\">recommend to read the book, \u201cQuick Start Guide to Oracle Fusion Development: Oracle JDeveloper and Oracle ADF\u201d <\/span><a href=\"http:\/\/www.amazon.com\/Quick-Start-Oracle-Fusion-Development\/dp\/0071744282\"><span style=\"vertical-align: baseline\"><span style=\"color: #1155cc\">http:\/\/www.amazon.com\/Quick-Start-Oracle-Fusion-Development\/dp\/0071744282<\/span><\/span><\/a><span style=\"vertical-align: baseline\">. It covers all of the basic areas of JDeveloper and ADF including the topics discussed below. <\/span><\/strong>\u00a0<\/span><br \/>\n<span style=\"vertical-align: baseline\">While you can define a lot of application logic via JDeveloper\/ADF declarative components, most logic that you need to add needs to be coded in Java. This is where AM, VO, and EO implementation classes and managed\/backing beans come into play. <\/span><\/p>\n<p><span style=\"vertical-align: baseline\">Every application has business logic and user interface logic. Web Development in general has fallen into a standard way of developing this logic. By which seperates application objects into four basic layers: Data Services, followed by Model, View, Controller (MVC). <\/span><\/p>\n<ul style=\"margin-top: 0pt;margin-bottom: 0pt\">\n<li><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\"><strong>Data Services:<\/strong><\/span><span style=\"vertical-align: baseline\"> Database, Web Services, XML Data, etc&#8230;<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\"><strong>Model:<\/strong><\/span><span style=\"vertical-align: baseline\"> Place for queries, C.R.U.D. operations, and any additional business logic<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\"><strong>View:<\/strong><\/span><span style=\"vertical-align: baseline\"> user interface objects<\/span><\/span><\/li>\n<li><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\"><strong>Controller:<\/strong><\/span><span style=\"vertical-align: baseline\"> Determines how user interface objects interact with one another.<\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\">Especially in an object oriented world that programming has become, separating your application logic and objects and making them reusable is key to a well structured and maintainable application. The MVC application architecture allows you to accomplish such a goal. <\/span><\/p>\n<p><span style=\"vertical-align: baseline\">Before we talk about what and how you would use java implementation classes of each Model layer object (AM, EO, VO), you need to understand the use and significance behind each object.<\/span><\/p>\n<p><span style=\"vertical-align: baseline\"><strong>Entity Objects (EO)<\/strong> are the source code representation of a database table. This is ultimately the layer that executes the insert, update, and delete commands against the database, however, an entity view object will need to present the EO.<\/span><\/p>\n<p><span style=\"vertical-align: baseline\"><strong>View Objects (VO)<\/strong> are read-only database queries or updatable view objects that represent an EO. All VOs are what are ultimately exposed as data controls in your Application Module &#8211; so that you can generate tables, forms, and other data-bound objects in your JSF pages.<\/span><\/p>\n<p><span style=\"vertical-align: baseline\"><strong>Application Module (AM)<\/strong> are what allow the ADF application to expose VOs and any other custom java business logic to a JSF page. For example, so you have a an employees database table, by which you have setup an EO and VO to work with that table. You can add the VO to your AM as a data control, so that you can generate an Employee insert or update form on your JSF pages. Basically Application Modules are the glue that allows your JSF Pages to view data of a view object.<\/span><\/p>\n<p><span style=\"vertical-align: baseline\">You can generate implementation classes on all three of these objects (EO, VO, and AM). When it comes to implementation classes, AM and VO Implementation classes are used the most often. Keep in mind these are very basic examples, you can do so much more with these classes:<br \/>\n<\/span><br \/>\n<\/span><\/p>\n<ul style=\"margin-top: 0pt;margin-bottom: 0pt\">\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"><strong>EO:<\/strong><\/span><\/span><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"> Unless you need to change how records are literally inserted, updated, or deleted, there is almost no need to use these. Once you start getting familiar with how the EO, VO, and AMs work, you\u2019ll understand.<\/span><\/span><\/li>\n<\/ul>\n<p style=\"background-color: transparent;;vertical-align: baseline\">\n<ul style=\"margin-top: 0pt;margin-bottom: 0pt\">\n<li><span style=\"font-family: Arial\"><span style=\"vertical-align: baseline\"><strong>VO:<\/strong><\/span> <\/span><\/li>\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"><strong>ViewObjectImplementation Class<\/strong><\/span><\/span><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\">: This gives you a comprehensive ability to change how your ViewObject is defined, how it queries an entity object or database, and how it functions in general.<br class=\"kix-line-break\" \/>For example, say you want to set a bind variable that is used in your View Object Query. ViewObjectImplementation classes give you the methods to set those bind variables.<\/span><\/span><\/li>\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"><strong>ViewObjectRowImplemtation Class<\/strong><\/span><\/span><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\">: This gives you the ability to change how the data of your view object attributes are set and retrieved. <br class=\"kix-line-break\" \/>For example, say you have a Project Task table where you have a Start Date, End Date, and Task Duration column. You want Task Duration to be\u00a0 (Start Date &#8211; End Date). RowImplementation Classes allow you to calculate (Start Date &#8211; End Date) and set the Task Duration Column.\n<p><\/span><\/span><\/li>\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"><strong>AM: <\/strong><\/span><\/span><\/li>\n<\/ul>\n<ul style=\"margin-top: 0pt;margin-bottom: 0pt\">\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"><strong>Application Module [Implementation] Class:\u00a0 <\/strong><\/span><\/span><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\"> This gives you comprehensive access to all of the data controls (View Objects) that you added to your AM. In addition, if you need to add any custom business logic, this is the recommended place to \u201cinitiate\u201d that logic. <br class=\"kix-line-break\" \/>For example, you can write a custom procedure to move data around or do advanced calculations in your Application Module Implementation class and expose them as a Data Control, so that you can use the data control on your JSF pages. <\/span><\/span><\/li>\n<li><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\">There are additional classes like \u201c<strong>Client Interface<\/strong>\u201d and \u201c<strong>Client Class<\/strong>\u201d, however all you need to know about these, is that they allow you to expose custom methods written in your Application Module Implementation class as a data control. <\/span><\/span><\/li>\n<\/ul>\n<p><span style=\"vertical-align: baseline\"><span style=\"font-family: Arial\">This article was written to quickly address, on the high level, many questions surrounding the use of implementation classes. More in-depth and comprehensive examples will be written in the PITSS knowledge base in the days to come. <\/span><br class=\"kix-line-break\" \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; If you are new to JDeveloper and ADF, then it is recommend to read the book, \u201cQuick Start Guide to Oracle Fusion Development: Oracle JDeveloper and Oracle ADF\u201d http:\/\/www.amazon.com\/Quick-Start-Oracle-Fusion-Development\/dp\/0071744282. It covers all of the basic areas of JDeveloper and ADF including the topics discussed below. \u00a0 While you can define a lot of application [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[49,26],"tags":[48],"class_list":["post-3887","post","type-post","status-publish","format-standard","hentry","category-adf-jdeveloper","category-development","tag-adf"],"_links":{"self":[{"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/posts\/3887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/comments?post=3887"}],"version-history":[{"count":2,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/posts\/3887\/revisions"}],"predecessor-version":[{"id":9148,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/posts\/3887\/revisions\/9148"}],"wp:attachment":[{"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/media?parent=3887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/categories?post=3887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pitss.org\/us\/wp-json\/wp\/v2\/tags?post=3887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}