\nNotice that the template file is a regular html file. This gives the exploiter alot of flexibility to layout the page. Also notice that attach points are created by declaring a \"comos.widget.WidgetContainer\" element and setting the \"attachPoint\" attribute to a tagname. This will identify these section of the page as attach points. As a result any views that are registered to any of these attach points are placed in the particular section within the page. It should be noted that the following lines are always required in a page template:\n\nThis will enable the dojo parser and include the COSMOS and dojo javascript files.\nWidgets\nViews are rendered by creating dojo widgets. The default views provided by the COMSOS ui are all widgets that have been inherited or composed of basic dojo widgets. The default widgets are developed in javascript files and deployed under /COSMOSUI/cosmos/widgets\nSince these views are dojo widgets exploiters familiar with working with dojo widgets can either create these widgets programmically or declaratively. Refer to the dojo documentation to understand how this is done.\nCreating new widgets\nIt is recommended that new widgets should be created using the dojo toolkit programming model. This will make deployment of the widgets easier with the COSMOS UI infrastructure. However it's not a requirement. Lets look at creating a tree widget to get an understanding how the COSMOS UI infrastructure exploits the dojo programming model.\ndojo.provide(\"my.widget.Tree'); dojo.declare( // class \"my.widget.Tree\", // superclass [dijit.Tree], // member variables/functions { title:'This is my tree', postCreate: function(){ alert(this.title); //call superclass my.widget.Tree.superclass.postCreate.apply(this, arguments); } } );\nThe above example shows a widget class that inherits the behavior of dijit.Tree. Exploiters can instantiate this new widget programmically as follows:\nvar mywidget = new my.widget.Tree({title:\"this is my title\"});\nThe above line will create my custom widget and change the title. Note that the properties of the widget can change by passing in a javascript object. Also note that the javascript object is in JSON format which is quite nice. As a result, exploiters can configure dojo widgets by providing JSON data. The COSMOS UI infrastructure exploits this behavior.\nView Configuration Files\nThe COSMOS UI introduces a notion of configuration files named as view.jprop. These configuration files will configure a particular view within the browser page. For example consider the following configuration file:\n{ clazz: \"cosmos.widget.Navigator\", initialize: \"MDRTreeJSON\", Query: {nodeClass:'mdr*'}, initQueryHandler: \"handler/json/nav.json\", publish: ['properties', 'detail'] }\nThe COSMOS UI runtime will process the above configuration file to configure a view within the page. A \"cosmos.widget.Navigator\" dojo widget will be instantiated and initialized with a set of properties specified in the configuration file. Therefore the above configuration file will translate to the following javascript code in the COSMOS UI runtime:\nvar mywidget = new cosmos.widget.Navigator({initialize: \"MDRTreeJSON\",Query: {nodeClass:'mdr*'},initQueryHandler: \"handler/json/nav.json\",publish: ['properties', 'detail']});\nNote that the \"clazz\" property is a specialized property that the COSMOSUI makes use of to determine the widget class to instantiate.\nNow let us look at trying to create a page that has three quadrants with different views. Let us create the following page:\nNote that I have a tree widget on the left hand side, a XML viewer on the top right quadrant and a properties table on the bottom right quadrant. To construct this page we first create the following report template.\n
\nNote that I use html tags and dojo widgets to construct the page. Since the page is a regular html page I can utilize existing layout widgets such as the dijit.layout.SplitContainer dojo layout container to construct my layout. I can utilize other layout containers defined by the DOJO toolkit ()\nAt certain sections within the page I add the following declartive text:\n
\nThis above text declares a \"detail\" attachpoint. Any view associated with a \"detail\" attach point will be rendered within this page section.\nNow let us look at configuring a tree view and attaching the view to the \"nav\" attach point specified in the page template. We create the following properties file.\n{ clazz: \"cosmos.widget.Navigator\", query: {nodeClass:'mdr*'}, initQueryHandler: \"handler/json/nav.json\", publish: ['properties', 'detail'] }\nNote that the \"clazz\" property refers to a cosmos dojo widget that is able to render a tree. This dojo widget is called \"comos.widget.Navigator\" and has a set of configuration properties. The following shows the properties that can be configured for the \"cosmos.widget.Navigator\" dojo widget:\nquery: the cosmos.widget.Navigator widget stores it's data model as a dojo data source (). As a result this property defines the query string to fetch the information to show the top level nodes\ninitQueryHandler: a url to a datafeed that provides the JSON data structure that will show the inital root nodes\npublish: a list of topics to publish node selection events to. Refer to the dojo event system for more information()\nI would save the configuration properties file as view.jprop under the views directory as follows:\n/views/nav/view.jprop\nBy saving the configuration file under /views/nav this \"attaches\" this view to the \"nav\" attach point. Similarly I would create configuration files for the properties table and BIRT report view and store them under /views/properties/view.jprop and /views/detail/view.jprop respectively.\nThe view can further be configured depending on the type of data that is presented in the view. For example, different icons can be associated with different nodes in the tree to signify certain visualization cues. As mentioned in the \"Data Tagging\" section, the data feeds may tag the data with metadata information. The views can uses this meta data to add visual decorators when representing the data within the view. The views can also use this metadata to change how the view behaves. For example, expanding a node in a tree may instantiate a different query object. Exploiters can define a data property file to associate a metadata tag to visual and behavioral cues. The following is an example of a data property file:\n{ mdr:{ menuType: {clazz:\"cosmos.widget.QueryMenu\", query:{clazz:\"cosmos.query.BasicQuery\", queryHandler:\"handler/cosmos/widget/Navigator/stat.json\"}, label: \"Create Query\"}, icon: \"images/cmdbf_query.gif\" }, mdrcbe:{ menuType: {clazz:\"cosmos.widget.QueryMenu\", query:{clazz:\"cosmos.query.CMDBfQuery\", queryHandler:\"handler/cosmos/widget/Navigator/stat.json\"}, label: \"sUBMITqUERY\"}, icon: \"images/cbe.gif\", expandQuery:{clazz:\"cosmos.query.BasicQuery\", queryHandler:\"handler/cosmos/widget/Navigator/cbe.json\"} }, mdrstat:{ icon: \"images/stat.gif\", expandQuery:{clazz:\"cosmos.query.BasicQuery\", queryHandler:\"handler/cosmos/widget/Navigator/stat.json\"} } }\nThe above example shows a data file that defines visual and behavioral cues for a tree widget. The tree will show the \"images/cmdbf_query.gif\" icon for any data tagged with a value of \"mdr\". Also a popup menu will be shown for any node that is visualizing data that is tagged with a value of \"mdr\".\nData Tagging\nThe COSMOS UI implores a RESTful Web 2.0 design pattern where the data is served by data feeds. The data feeds provide JSON datastructures. The structure of the JSON data is consumed by the view widget. Note that the JSON data structure provides a contract between the backend data and the user interface. This architecture provides a clear decoupling between the raw data and the user interface. As a result, new UI widgets, that conform to the JSON contract, can be constructed to create different visualizations. The following is an example of a JSON structure used to send a list of three nodes to a tree widget.\n{ identifier: \"object\", label: \"title\", items:[ {tag:\"mdrstat\", title:\"Statistical Data\",object:“21\"}, {tag:\"mdrcbe\",title:\"Monitoring Data\",object:\"14\"}, {tag:\"mdr\",title:\"Asset Repository\", object:“91\"},} ] }\nThe above example defines three objects that have three attributes (tag, title, and object). The tree widgets uses these atributes to construct nodes within the tree. The title attribute signifies the name of the node, the object attribute provides a unique id and the tag attribute provides meta data information. The tag attribute is an important attribute that is processed by the COSMOS widgets. The widgets makes use of the tag attribute to determine if certain visual or behavorial cues should be applied to the node. For example, a specific icon can be rendered for data with specific tag values or different menu items can be shown in the menu bar for specific tagged data.\nData Feeds\nThe COSMOS UI infrastructure will implore a RESTful service architecture. Data models required by the DOJO widgets will be produced by JSON feeds via HTTP requests as illustrated below:\nNote that query objects are created to create the binding logic between the DOJO widget and the HTTP request as mentioned in the previous sections.\nThe following is an overview how data feeds will be constructed.\nA request delegator will receive the request and instantiate a particular outputter that will handle the request. The request delegator will provide interfaces to deserialize the request into a set of parameters that the outputter understands. The request delegator will also provide a global store that outputters can save state data. Note that the outputter themselves are stateless and can only change the state of the store.\nClient browsers can make a request to a particular data feed by constructing the appropriate HTTP request. Consider the following request\n/COSMOSFeeds?service=/org/eclipse/cosmos/provisional/tree/json¶m1=2343245¶m2=select\nCOSMOS will provide a single service that will receive requests from the client to generate a particular data feed. The \"service\" parameter will dictate the outputter to instantiate. For example, the above request will cause the request delegator to instantiate org.eclispe.cosmos.provisional.tree.json.Outputter. The delegator will pass a parameter map with two parameters: param1 and param2. Exploiters can define custom outputters and add the outputter class to the classpath of the request delegator.\nThe following define the IOuputter, IParameters and IStore interfaces.\nIOutputter\n/** * Provides data feeds */ public interface IOutputter { /** * A resolver class that will generate unique ids. unique ids * may be required by the outputter to identify particular items in * the generated output. * @param idResolver id resolving class */ public abstract void setIdResolver(IIDResolver idResolver); /** * Writes content to a PrintWriter. An input map is passed to this method * that the render method will use to generate the data feed * @param output a PrintWriter that method will write to * @param input an input map that contains name value pairs * @throws Exception */ public abstract void render(PrintWriter output, IParameters input) throws Exception; /** * This method is called write after instantiating the outputer. A persisted storage * object is passed that outputters can use to save state * @param store a persistent storage object * @param parameters an input map that contains name value pairs * @throws Exception */ public abstract void initalize(IStore store, IParameters parameters) throws Exception; }\nIParameters\n/** * Provides a list of name value map that is used by outputters as input * parameters. */ public interface IParameters { /** * Returns a parameter value with an associated key name * @param name - key name * @return value of the parameter */ public String getParameter(String name); }\nIStore\n/** * Persistent storage used by outputters to save state */ public interface IStore { /** * Returns a value from the store with provided key name * @param name - key name * @return stored value */ public abstract Object getAttribute(String name); /** * Stores a value with an associated key name * @param name - key name * @param value - value to store */ public abstract void setAttribute(String name, String value); }\nError Handling\nClient-side error handling is discussed in enhancement 209223\nDeployment Model\nAs explained in the previous sections there are several components involved in the COSMOS UI infrastructure. These components are as follows:\n- Page Templates\n- Widgets\n- View Configuration Files\nThe COSMOS UI infrastructure defines a deployment model to deploy the above components:\n/dojo -Directory where dojo widgets and classes are deployed /pages -Directory where pages are deployed /views -Directory to store view and data configuration files\nThe page directory is further structured as follows:\n/pages//index.html - defines the page template /pages//images - defines images associated with the page template /pages//css - defines style sheets associated with the page template\nNote a namespace is associated with a page template. This allows the COSMOS ui infrastructure to server many different pages. For example I can define two diffent pages with different layout and view configurations such as:\n/pages/cosmos/index.html /pages/cosmosBlue/index.html\nTo access each page I would enter the following urls respectively:\nThe Dojo directory is further structured as follows:\n/dojo/cosmos - contains comsmos dojo widgets and classes /dojo/cosmos/provisional/widget - defines cosmos widgets /dojo/cosmos/provisional/utility - defines cosmos utility classes /dojo/cosmos/provisional/data - defines cosmos data classes\nNote that the above naming convention follows a similar pattern suggested by the Eclipse Naming document ()\nExploiters can deploy their own widgets and classes under the 'dojo' directory. For example, the following defines custom classes under the dojo/mywidget\ndirectory:\n/dojo/mywidget\nThe view directory contains the view and data property file. The structure of the view directory is explained in the previous section."},"url":{"kind":"string","value":"http://wiki.eclipse.org/CosmosDataReportingComponent10_209226"},"dump":{"kind":"string","value":"CC-MAIN-2014-42"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":212,"cells":{"text":{"kind":"string","value":"\nSeam Book (Yuan & Heute) Hello World Example Annotation\nJohn Peters\nGreenhorn\nJoined: May 25, 2007\nPosts: 18\nposted\nFeb 11, 2008 13:27:00\n0\nIn Michael & Thomas' Seam book, in the chapter 2 Hello World example, why is the \"person\" variable outjected? Doesn't the \"@Name\" annotation on the Person entity already make the \"person\" available to Seam?\nThanks!\nSLSB:\n@Stateless @Name(\"manager\") public class ManagerAction implements Manager { @In @Out private Person person; @Out private List fans; @PersistenceContext private EntityManager em; public String sayHello(){ em.persist(person); person = new Person(); fans = em.createQuery(\"select p from Person p\").getResultList(); return null; }\nEntity:\n@Entity @Name(\"person\") public class Person implements Serializable { private long id; private String name; @Id @GeneratedValue public long getId(){ return id; } public void setId(long id){ this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } }\nXHTML:\n
Please Enter your name:
\n[ February 11, 2008: Message edited by: John Peters ]\nHussein Baghdadi\nclojure forum advocate\nBartender\nJoined: Nov 08, 2003\nPosts: 3479\nI like...\nposted\nFeb 11, 2008 23:46:00\n0\nYou use @Name to tell Seam that this is a Seam component and the component will be bijected under this name (you can override it however).\nTo actually outject a component you need to use @Out.\nHTH.\nJohn Peters\nGreenhorn\nJoined: May 25, 2007\nPosts: 18\nposted\nFeb 12, 2008 06:39:00\n0\nHey John, thanks for the reply. I think I'm following you, but I'd like some clarification, please:\nI was playing around with the SLSB and removed the \"@Out\" annotation on the \"person\" variable, so the SLSB looks like this:\n@Stateless @Name(\"manager\") public class ManagerActionBean implements ManagerAction { @In private Person person; @Out private List fans; @PersistenceContext private EntityManager em; public String sayHello(){ em.persist(person); person = new Person(); fans = em.createQuery(\"select p from Person p\").getResultList(); return null; } }\nAfer redeploying the EAR, everything still worked without any problems. My confusion is why did the authors annotate the \"person\" class (that is injected in the SLSB) with \"@Out\" to begin with? It appears Seam was able to create an entity bean just by using the \"@Name\" annotation on the entity bean itself, and the \"@Out\" annotation on the SLSB for the \"person\" class was redundant. Is this correct or am I missing something?\nThanks again, for your help. I've been reading everything I can on bijection and still haven't had the epiphany I need.\nHussein Baghdadi\nclojure forum advocate\nBartender\nJoined: Nov 08, 2003\nPosts: 3479\nI like...\nposted\nFeb 13, 2008 01:40:00\n0\nThink of it in this way:\nWhen you annotate a Seam component with @Out, you are telling Seam that you want to store this component under some scope.\nRemember those lines:\nPurchaseOrder po = new PurchaseOrder();\nsession.setAttribute(\"purchaseOrder\", po);\nWhen you are using @Out, you are doing the same thing.\nAlternativley, when you are using @In, you are telling Seam you want to get the object from a desired scope (context in Seam parlance)\nRemember this line:\nsession.getAttribute(\"purchaseOrder\");\n?\nIn your case, yes sure, you can remove @Out from person declaration but you can't write this in your view page:\n Apple's interface is elegant but inflexible. Everything fits into the existing scheme and runs perfectly within that scheme.\nBullshit.\nJust look at the \"zoom button\" debacle on OSX. There is no \"maximize window\" functionality. The little green button with a \"+\" in it often makes the window *smaller* - or minimizes it (in the case of iTunes).\nThe OS is filled with these massive problems because it has been simplified to the point of being retarded.\nRe:What Apple does right (1)\njordibares (1276026) | more than 4 years ago | (#30071714)\nRe:What Apple does right (1)\nXest (935314) | more than 4 years ago | (#30071774) is relevant in the context of the actions being carried out for their applications too.\nSo the question is, whilst to some people like you and I the simplified context relevant system seems better, is there an underlying reason many others hate it? Do they simply dislike change? or is there something else there, like a context based system being more confusing for them because things aren't always where they were?\nFor what it's worth though I actually hate many of the Windows 7 changes, the new gadget system is appalling compared to the sidebar. Gadgets are useless because they're either on the desktop, out the way, and you have to explicitly switch to the desktop to see them in which case if you have to explicitly switch they may as well just be applications or alternatively they can be set to be always on top which means they obscure any windows you're working with underneath them. The sidebar ensured this wasn't a problem by allowing Windows to resize around the sidebar meaning they were both always on top, always available and yet never in the way.\nI also found the taskbar changes unhelpful on a large screen, although it's great on the small screen of my netbook where taskbar space is limited, but on my 24\" screen at 1900x1200 the new system only uses up about 20% of the length of the taskbar and yet I have to take extra clicks to find the window I want because they're all hidden in their groups. I reverted back to the classic taskbar where the Window I want is available instantly by using the full taskbar.\nI even find the start menu since Vista much less efficient to navigate too in all honesty, if you don't type in the name of the program and want to click through because you don't know what icon was added the pre-Vista start menu was far more efficient.\nAs I say though, I do like Microsoft's ribbon interface. For me it's all about the speed and efficiency at which I can work, and much of the Windows Vista / 7 UI changes seem to add the amount of mouse movement and clicks I need to make, the Ribbon UI however does not as it puts what I need right in front of me when I need it.\nRe:What Apple does right (0)\nAnonymous Coward | more than 4 years ago | (#30071812)\nWindows' interface is flexible but clumsy. While this has gotten much better in later versions, we're still looking at deeply nested menus, and applications which do not necessarily have any UI themes in common with each other.\nPlease, please do not try to hang \"applications which do not necessarily have any UI themes in common with each other\" on Windows alone.\nAny GUI operating system that allows skinning of applications, whether by design, or by sheer bloodyminded overriding of low-level user interface drawing routines, will eventually have this problem as soon as some programmer decides that he doesn't like the \"standard, boring, old window style\" and he then proceeds to inflict his new \"vision\" of what the interface should look like on the user.\nThen you wind up with non-rectangular windows in garish colors of the programmer's choosing with buttons that don't look like buttons, no visible menu bar, and few, if any, of the features users are used to seeing in their application windows.\nRe:What Apple does right (1)\nzmollusc (763634) | more than 4 years ago | (#30071892) try a more modern mac and see how things have altered.\nSo? (5, Insightful)\nwar4peace (1628283) | more than 4 years ago | (#30071436)\nWe are living in a twisted, perverted world, where one can't express an opinion without being beheaded by both the press and the company he's working for. God help us all!\nHi (5, Funny)\nAnonymous Coward | more than 4 years ago | (#30071440)\nI'm a Mac and Windows 7 was MY idea\nNews of \"staff restructuring\"... (0)\nAnonymous Coward | more than 4 years ago | (#30071442)\n...coming to the guy in 3... 2... 1...\nIf only.... (-1, Troll)\nAnonymous Coward | more than 4 years ago | (#30071444)\nRe:If only.... (0)\nAnonymous Coward | more than 4 years ago | (#30071494)\nemployee who 'inaccurate and uninformed' (4, Insightful)\nhibernia (35746) | more than 4 years ago | (#30071462)\nRe:employee who 'inaccurate and uninformed' (0)\nAnonymous Coward | more than 4 years ago | (#30071596)\nMistaken is the Official Rebuttal not the comment (1)\nviraltus (1102365) | more than 4 years ago | (#30071468)\nHello Streisand (3, Insightful)\nje ne sais quoi (987177) | more than 4 years ago | (#30071474):Hello Streisand (2, Insightful)\nbruno.fatia (989391) | more than 4 years ago | (#30071644).\nIf this is true... (0, Troll)\nsitarlo (792966) | more than 4 years ago | (#30071476)\nRe:If this is true... (4, Insightful)\nrecoiledsnake (879048) | more than 4 years ago | (#30071510)\nWindows 7 is still clunky, slow, and unstable.\nCitation needed. I use Windows 7 and it's certainly not one of those.\nRe:If this is true... (-1, Troll)\nsitarlo (792966) | more than 4 years ago | (#30071600)\nRe:If this is true... (2, Informative)\nkannibal_klown (531544) | more than 4 years ago | (#30071514) this is true... (0)\nAnonymous Coward | more than 4 years ago | (#30071554)\nYou don't know how to use it properly then...\nI am no Windows fan, I have Snow Leopard, Windows 7, XP and Linux (Suse, RedHat, CentOS and unbreakable Linux) all on differing machines...\nAll in all, Windows 7 has been stable as a rock on my machine...no problems to report apart from lacking Samsung Scanner Drivers...not MS' fault.\nThis is not like OS X! (5, Funny)\nzebslash (1107957) | more than 4 years ago | (#30071490)\nMicrosoft has issued an official rebuttal: \"We never used OS X as a source of inspiration in the design of Windows 7. This is completely uninformed. We used KDE 4 instead\".\nIdeas don't occur in a vacuum (3, Insightful)\nInteroperable (1651953) | more than 4 years ago | (#30071506)\nHi, my name is Steve Jobs... (1, Redundant)\nDaRanged (735002) | more than 4 years ago | (#30071532)\nShould've named it Vista7 or Vista-II instead.. (1)\njkrise (535370) | more than 4 years ago | (#30071534):Should've named it Vista7 or Vista-II instead.. (1)\nsmitty777 (1612557) | more than 4 years ago | (#30071658)\nNot sure about that. I think they're trying to distance themselves from Vista. I do agree with you in concept, tho.\nRe:Should've named it Vista7 or Vista-II instead.. (1)\nXest (935314) | more than 4 years ago | (#30071860) earmed from it's crappy earlier releases.\nThat was close (1)\nlyinhart (1352173) | more than 4 years ago | (#30071540)\nLinux users (-1, Troll)\nAnonymous Coward | more than 4 years ago | (#30071556)\nAre butt hurt that they cant\n/dev/null their /etc/fstab\nPaging Mr. Balmer (1)\nm0s3m8n (1335861) | more than 4 years ago | (#30071578)\nDefenseable (0)\nAnonymous Coward | more than 4 years ago | (#30071586)\nSounds to me like the \"Liar, liar, pants on fire defense\"\nI'm a Mac (1, Redundant)\nJezza (39441) | more than 4 years ago | (#30071594)\nI'm a Mac, and Windows 7 was my idea!\nI agree with MS (-1, Troll)\nAnonymous Coward | more than 4 years ago | (#30071630)\nBad Analogy (courtesy MS) (1)\nsmitty777 (1612557) | more than 4 years ago | (#30071632)\nFTA: \"When the sun is shining there’s no incentive to change the roof on your house. It’s only when its raining that you realise there’s a problem.\"\nAhem....um...so I guess by rain, you mean some sort of Katrina like attention getter? Sheesh...\nLook and Feel (2, Interesting)\nAdrian Lopez (2615) | more than 4 years ago | (#30071734).\n\"built on that very stable core Vista technology\" (0)\nAnonymous Coward | more than 4 years ago | (#30071750)\nFrom the article: \"it’s built on that very stable core Vista technology, which is far more stable than the current Mac platform, for instance.\"\nApple's development model, for years, has been to perpetually tweak and improve on their existing operating system code. Not to mention it's Unix, which has been around since the dinosaurs. He even says in the article that XP was completely rebuilt for Vista, which was then gutted again for this new Vista2. He wants to talk about stability? Why am I surprised?\nM$, You Stupid Fools (-1, Troll)\nAnonymous Coward | more than 4 years ago | (#30071814)\nDeny, deny, deny... it doesn't change the fact that M$ ripped most of its UI improvements directly from OS/X. Imagine if someone did that to M$... you'd be sued into oblivion. M$ you suck.\nSounds like.... (1)\nSendBot (29932) | more than 4 years ago | (#30071900)\nsounds like someone doesn't want to get sued by apple for defamation.\nSomeone got called out (2, Insightful)\nonyxruby (118189) | more than 4 years ago | (#30071912).\nIf you believe in... (0)\nAnonymous Coward | more than 4 years ago | (#30071962)\nevolution. Then the chances of a random chain of events leading to Windows 7 looking like OS X is possible. It might even be the only explanation."},"url":{"kind":"string","value":"http://beta.slashdot.org/story/127122"},"dump":{"kind":"string","value":"CC-MAIN-2014-42"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":214,"cells":{"text":{"kind":"string","value":"When you think Ruby, what is your first association? Oh, it's Rails? Hmm. What is you think Ruby feature? Monkey patching? Yep, me too. Programmers have stronger and more heated opinions about monkey patching than adolescent girls have about glitter. Globally modifying class functionality at runtime? Why yes, that does sound dangerous.\nWith a little imagination you can imagine a doomsday scenario where two libraries wrestle with each other continually to replace some piece of functionality with their own preferred version, and with each release the library maintainers modify their code to move their library back to the top of heap1.\nHowever, monkey patching does provide a solution an important problem: dynamically adding functionality to a class at run-time. Over in Python land we don't have a great solution to this problem, and we've kind of decided we're okay with that: better not to have a zoo than have the lions occasionally escape and gnaw on small children.\nHowever, there is a great solution to this problem. One that allows dynamically adding functionality to a class--nay, to classes--while respecting namespaces and not mucking up the reasonable assumptions in other peoples' code (primarily the assumption that a function won't, without warning, suddenly begin behaving differently, which is a rather important assumption for writing even moderately deterministic code):\nLike many great ideas that have slowly seeped into modern programming languages, this idea comes from Lisp--more specifically, Common Lisp--but this one in particular hasn't yet resurfaced in a mainstream language. The solution? Generic functions (also called multi-methods) like those in CLOS. Let's do a few examples of what Python might be like if it had generic function based OO.\nclass Person(object): name = None title = None def greet(Person p): print \"Hello %s %s\" % (p.name, p.title)\nSo the key difference is that some parameters are typed with a class. Lets say that anything that isn't explicitly typed can be of any type, so we're using an eclectic mix of strong typing and duck-typing (similar to Objective-C).\nThe first advantage we get is that we can add functionality to a class\nfrom any module, not just in its class declaration. For example, if\nthe above code is in a module named\nPersonModule, then we could write\nthis code in another module:\nfrom PersonModule import Person, greet def farewell(Person p): print \"Goodbye %s %s\" % (p.name, p.title) def greet_goodbye(Person p): print greet(p) + \", \" farewell(p) p = Person() p.name = 'Will' p.title = 'Mr.' greet(p) # print \"Hello Mr. Will\" farewell(p) # print \"Goodbye Mr. Will\"\nSo we can add methods to an object declared in a different module, but what if we want to override an object's default behavior in our module? Easy as pie.\nfrom PersonModule import Person, greet_goodbye def farewell(Person p): return \"k thnx bai %s\" % p.name p = Person() greet_goodbye(p) # prints \"Hello Mr. Will, k thnx bai Will\"\nSo that's kind of cool, right? Sure, I'm pulling this out of thin air and can't even prove to you that what I'm suggesting is possible, but this is how OO works with CLOS. There is a working precedent.\nAnd it's awesome.\nThe joy of generic functions goes a bit further than this as well, giving us some functionality that feels similar to the type matching found in Erlang or Scala. Consider this code:\nclass Person: name = None class Dog: name = None def speak(a): 'If none of the more specific patterns match, falls back here.' print \"This is a %s\" % a def speak(Person p): print \"My name is %s\" % p def speak(Dog d): print \"Woof\" def walk(Person p, Dog d): print \"%s takes %s for a walk\" % (p,d) def walk(Dog d, Person p): print \"%s cannot walk %s\" % (d,p) def walk(Person p, Person p): print \"Um. That's weird.\" a = Person() a.name = \"Will\" b = Dog() b.name = \"Leo\" c = Person() c.name = \"Jim\" walk(a,b) # \"Will takes Leo for a walk\" walk(b,a) # \"Leo cannot walk Will\" walk(a,c) # \"Um. That's weird.\"\nFor those who have used 'real' pattern matching, this will seem like a very cumbersome syntax, but fortunately generic methods don't just give us pattern matching, along with the heavier syntax comes heavier capabilities:\n- Rather than only matching on types, the ability to use classes for pattern matching as well. (You could also phrase this as, classes are a valid type for matching.) That includes giving us polymorphism by specializing methods on increasingly specific classes (\nProgrammerinstead of\nPerson,\nPerlProgrammerinstead of\nProgrammer).\n- Ability to override handling of a specific pattern, without rewriting the rest of the patterns.\nThat said, it doesn't necessarily allow for all of the functionality of pattern matching, because you can't customize the order in which it will attempt to match the pattern (will always go from more specific to more general in a predictable and consistent order, while pattern matching will let you define any ordering your heart desires)2.\nAlso, depending on the implementation it might not allow specializing on values (instead of just types), but it would be fairly intuitive to add value-specialization to the syntax:\ndef add(a,b): return a + b def add(a, 0): return a\nThat would open up some pretty interesting doors. Doors I would like to walk through. (Actually, looks like those doors are already discussed here, and opened here. Now I just need to start walking. Err, and I'd like the syntax to be native. Maybe a pre-compiler of some sort is in order.)\nThis sounds stupid, doesn't it? It is, and the tragedy is that something comparable occurs all the time in the worlds of anti-virus and toolbars.↩\nDepending on the specific implementation (basically, where one establishes the trade-off between explicitly importing all multi-methods you'll use versus them being implicitly imported when you load a module to save typing), it is possible to create a predictable system for multiple inheritance, although at the expense of many many more imports.↩"},"url":{"kind":"string","value":"http://lethain.com/the-subtle-joys-of-generic-methods/"},"dump":{"kind":"string","value":"CC-MAIN-2014-42"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":215,"cells":{"text":{"kind":"string","value":"\nOnline Assistants on E-Commerce can be Helpful\nassistant is really very helpful. You can easily employ ghost writers or even...Online Assistants on E-Commerce can be Helpful\nThe task is tedious when... assistants on E-commerce which may prove very helpful and productive. The online\nStruts validation not work properly - Struts\nStruts validation not work properly hi...\ni have a problem with my struts validation framework.\ni using struts 1.0...\ni have 2 page which...) {\nthis.address = address;\n}\n}\nmy struts-config.xml\nTomcat Quick Start Guide\nTomcat Quick Start Guide\n ... fast tomcat jsp tutorial, you will learn all the essential steps need to start... that work with Java inside HTML pages. Now we can\ntake any existing HTML\nStruts Reference\nStruts Reference\nWelcome to the Jakarta Online Reference page, you will find everything you\nneed to know to quick start your Struts...\nStruts Validation framework with example\nStruts Tiles example\nStruts\nvalidator framework work in Struts\nvalidator framework work in Struts How does validator framework work in Struts\nStruts Books\nstarted really quickly? Get Jakarta Struts Live for free, written by Rick Hightower... for Struts applications, and scenarios where extending Struts is helpful (source code... it. Instead, it is intended as a Struts Quick Start Guide to get you going. Once you\nJava Kick Start - Java Beginners\nfeedback. Im very muck exicted to work with java programming. Thank You... of examples related to different technologies like, jsp, servlet, struts, ejb... in core java, collections then you can start with JSP and Servlets.\nhttp\ntiles - Struts\nStruts Tiles I need an example of Struts Tiles\nJava Web Start and Java Plug-in\nof cache for Java Web Start or Java\nPlug-in will no longer work. Existing applications...\nJava Web Start Enhancements in version 6\n ... Java Web\nStart should check for updates on the web, and what to do\nsing validator framework work in struts\nsing validator framework work in struts How does client side validation using validator framework work in struts\nStruts Quick Start\nStruts Quick Start\nStruts Quick Start to Struts technology\nIn this post I will show you how you can quick start the development of you\nstruts based project... of the application fast.\nRead more: Struts Quick\nStart\nStruts Console\nvisually edit Struts, Tiles and Validator configuration files.\nThe Struts Console... Struts Console\nThe Struts Console is a FREE standalone Java Swing\nHow about this site?\nJava services What is Java WebServices?\nIf you are living in Dallas, I'd like to introduce you this site, this home security company seems not very big, but the servers of it are really good.\nDallas Alarm systems\n| Site\nMap | Business Software\nServices India\nStruts 2.18 Tutorial Section\nStruts 2.1.8 |\nStruts 2.1.8 Features |\nDownloading and installing... with Struts Tiles |\nUsing\ntiles-defs.xml in Tiles Application |\nStruts\nUseful Negotiation Tips on Outsourcing, Helpful Negotiation Tips\nthat one or two issues need more time to be sorted\nout. Transfer the work....\nMoving the work to the outsourcer before the contract is\nsigned gives... consultants may\nwork for their own vested interests rather than help you\nHow does Social Media Marketing Work\nMarketing really works for\nyour website.\nHow does Social Media Marketing Work...How does Social Media Marketing Work\nIn this section we will understand....\nand then the friends list. Try to create long friend list.\nThen you can start\nwhere to start - Java Beginners\nis that I shall start practicing from the day one to make myself get the knowledge of java.Shall i get a series of questions or programmes for a beginner to work on. Hi,\nThanks for using RoseIndia.net\nYou can start learning java\ntomcat server start up error - Struts\ntomcat server start up error\nHai friends.....\nwhile running... org.apache.catalina.core.StandardService start\nINFO: Starting service Catalina\nSep 5, 2009 4:49:08 AM org.apache.catalina.core.StandardEngine start\nINFO: Starting Servlet Engine: Apache\nMyEclipse Hibernate Tutorial\nThis tutorial is helpful to understand how hibernate work in MyEclipse\nSubmitting Web site to search engine\nin the\nsearch, you will start getting hits to your site without and cost. ...\nRegistering Your Web Site\nTo Search Engines... Web Sites\nOnce your web site is running, the next job for you\nStruts Articles\n, but the examples should work in any container. We will create a Struts plugin class... popular Struts features, such as the Validation Plug-In and Tiles Plug... portal is in leveraging Struts Tiles. Portals are, in essence, a set\nSuccessful Tips for Offshore Outsourcing,Helpful Tips of Success Offshore Outsourcing\n,\nit is not a cakewalk to get your work done through a company\nthat operates from a different... progress of the work.\nAnticipate Delays\nOne of the most important steps in planning\nStruts Tutorials\nis provided with the example code. Many advance topics like Tiles, Struts Validation... how to start and stop Tomcat, install Struts, and deploy a Struts application... great tutorials posted on this site and others, which have been very helpful\nwhich tags work on which browsers\nwhich tags work on which browsers Is there a site that shows which tags work on which browsers\nStruts - Framework\n/struts/\". Its a very good site to learn struts.\nYou dont need to be expert...Struts Good day to you Sir/madam,\nHow can i start struts application ?\nBefore that what kind of things necessary\nHibernate Tools Update Site\nHibernate Tools Update Site\nHibernate Tools Update Site\nIn this section we... Site. The anytime you can user Hibernate\nTools Update Manager from your eclipse\nimport package.subpackage.* does not work\nto this\nJava Web Start Enhancements in version 6\nStart or Java\nPlug-in will no longer work. Existing applications cache...\nJava Web Start Enhancements in version 6\n ... supported. It describes the applications preferences for how Java Web\nStart\nStruts + HTML:Button not workin - Struts\nStruts + HTML:Button not workin Hi,\nI am new to struts. So pls... in same JSP page.\nAs a start, i want to display a message when my actionclass...:\nhttp\nstruts\nfor clarifying my doubts.this site help me a lot to learn more & more technologies like servlets, jsp,and struts.\ni am doing one struts application where i... the following links:\nStruts - Framework\n,\nStruts :\nStruts Frame work is the implementation of Model-View-Controller...Struts Good day to you Sir/madam,\nHow can i start struts application ?\nBefore that what kind of things necessary\nPHP and MySQL Work Well Together\nto upload items or comments on a site.\nThe MySQL database can work especially well... important for anyone to use.\nThe first thing to know is that the PHP script can work well for a dynamic site. It can help to understand this by seeing Struts Works\nthe\ncontainer gets start, it reads the Struts Configuration files and loads... gets start up\nthe first work it does is to check the web.xml file and determine...\nHow Struts Works\n \njava - Struts\ngive me idea how to start with Hi Friend,\nPlease clarify what do you want in your project.\nDo you want to work in java swing?\nThanks\nIf statement doesn't work ,(doesn't print alert message when user dont field name and email)\na download when a user hit click jf he fields name and email but doesn\"t work for my site...If statement doesn't work ,(doesn't print alert message when user dont field...';\n$subject = 'Message from a site visitor '.$field_name;\n$bodymessage = 'From\nOffshore Outsourcing Tips,Useful Offshore Outsourcing Tips,Helpful Outsourcing Tips\ncompetitive. Companies and people have to work with people\nwho they know....\nFor instance, if you are outsourcing work from India, you\nneed to go... of how things work\nProfessional Web Design Services For You Web Site\nProfessional Web Design Services For You Web Site\n ... designer\nIf the content of your website is such that it requires art work... requirements, he will in turn give you a rough sketch of the proposed\n.shtml\nHope that the above links will be helpful for you.\nThanks\nStruts Guide\n? -\n- Struts Frame work is the implementation of Model-View-Controller\n(MVC) design... the official site of\nStruts. Extract\nthe file ito...\nStruts Guide\n \nstruts - Struts\nstruts Hi,\nI need the example programs for shopping cart using struts with my sql.\nPlease send the examples code as soon as possible.\nplease...\nHope that it will be helpful for you.\nThanks\nstruts
hi here is my code in struts i want to validate my form fields but it couldn't work can you fix what mistakes i have done
27 * Details regarding the TFTP protocol and the format of TFTP packets can 28 * be found in RFC 783. But the point of these classes is to keep you 29 * from having to worry about the internals. Additionally, only very 30 * few people should have to care about any of the TFTPPacket classes 31 * or derived classes. Almost all users should only be concerned with the 32 * {@link org.apache.commons.net.t} class 33 * {@link org.apache.commons.net.t receiveFile()} 34 * and 35 * {@link org.apache.commons.net.t sendFile()} 36 * methods. 37 * 38 * 39 * @see TFTPPacket 40 * @see TFTPRequestPacket 41 * @see TFTPPacketException 42 * @see TFTP 43 ***/ 44 45 public final class TFTPWriteRequestPacket extends TFTPRequestPacket 46 { 47 48 /*** 49 * Creates a write request packet to be sent to a host at a 50 * given port with a filename and transfer mode request. 51 * 52 * @param destination The host to which the packet is going to be sent. 53 * @param port The port to which the packet is going to be sent. 54 * @param filename The requested filename. 55 * @param mode The requested transfer mode. This should be on of the TFTP 56 * class MODE constants (e.g., T). 57 ***/ 58 public TFTPWriteRequestPacket(InetAddress destination, int port, 59 String filename, int mode) 60 { 61 super(destination, port, TFTPPacket.WRITE_REQUEST, filename, mode); 62 } 63 64 /*** 65 * Creates a write request packet of based on a received 66 * datagram and assumes the datagram has already been identified as a 67 * write request. Assumes the datagram is at least length 4, else an 68 * ArrayIndexOutOfBoundsException may be thrown. 69 * 70 * @param datagram The datagram containing the received request. 71 * @throws TFTPPacketException If the datagram isn't a valid TFTP 72 * request packet. 73 ***/ 74 TFTPWriteRequestPacket(DatagramPacket datagram) throws TFTPPacketException 75 { 76 super(TFTPPacket.WRITE_REQUEST, datagram); 77 } 78 79 /** 80 * For debugging 81 * @since 3.6 82 */ 83 @Override 84 public String toString() { 85 return super.toString() + \" WRQ \" + getFilename() + \" \" + T(getMode()); 86 } 87 }"},"url":{"kind":"string","value":"http://commons.apache.org/proper/commons-net/xref/org/apache/commons/net/tftp/TFTPWriteRequestPacket.html"},"dump":{"kind":"string","value":"CC-MAIN-2018-17"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":234,"cells":{"text":{"kind":"string","value":"Have you ever wanted to open a console in the middle of an application that doesn't usually support one? This article explains exactly how to master the console.\nThe console is a bit of a mystery to many .NET programmers.\nYou can create a console application very easily and there is a Console class which allows you to interact with the user at a very basic level.\nThe problems start when you are in the middle of some non-console-based project and suddenly it would be useful to pop-up a console window.\nYou might think, given that there is a Console class, that this should be easy. All you should have to do is create an instance of Console and start using it.\nOf course when you look at the situation a little more carefully this isn't possible because Console is a static class and hence there is no way of creating an instance. At this point you might be tempted to give up and program your own class using a form of some kind, but it is possible to use a console in any application including a .NET forms or WPF application.\nThe first thing to realise is that the console window is provided by the operating system not the .NET framework. It’s the command prompt that you use to do jobs that can't easily be achieved via the usual GUI.\nThere are OS native API calls which create and destroy the console and these are used in the .NET Console application template to provide a console for the Console class to wrap.\nAs there can be only one console attached to a process at any one time the Console class works in a very simple way. When you reference any Console method it simply makes use of the currently attached console. So in principle if you manually create a console you should be able to use the Console static class to work with it and so avoid having to create your own wrapper.\nThe console API is very simple. There is an API call that will create and attach a new console:\n[DllImport(\"kernel32\",SetLastError = true)]static extern bool AllocConsole();\nIf it is successful it returns true and generally the only reason for it to fail is that the process already has a console attached. If you want to discover the error code that the call generated use the .NET method:\nMarshal.GetLastWin32Error()\nIf a console already exists and is attached to another process you can attach it to the current process using:\n[DllImport(\"kernel32.dll\", SetLastError = true)]static extern bool AttachConsole( uint dwProcessId);\nIn most cases the console that you want to attach belongs to the parent process and to do this you can use the constant:\nconst uint ATTACH_PARENT_PROCESS= 0x0ffffffff;\nThere is also a FreeConsole API call that will dispose of any currently attached console:\n[DllImport(\"kernel32.dll\", SetLastError = true, ExactSpelling = true)]static extern bool FreeConsole();\nThere is also a long list of other console API calls but in the main you don't need these because the Console class provides you with managed alternatives. For example, there is a Set and Get ConsoleTitle API call, but the Console property Title does the same job by calling the API for you.\nPutting theory into practice is very easy. First you need to make sure you have all the necessary declarations:\nusing System.Runtime.InteropServices;\n[DllImport(\"kernel32\", SetLastError=true)] static extern bool AllocConsole();[DllImport(\"kernel32\", SetLastError=true)] static extern bool AttachConsole( uint dwProcessId);const uint ATTACH_PARENT_PROCESS = 0x0ffffffff;\nA single method is all we need to either create or attach an existing console:\npublic void MakeConsole(){ if (!AttachConsole(ATTACH_PARENT_PROCESS)) { AllocConsole(); };}\nYou can add some error handling to this to make it more robust but if there is an error the only consequence is that the Console class subsequently doesn’t work.\nTo test it out try:\nMakeConsole();Console.Beep();Console.Title=\"My Console\";Console.WriteLine(\"Hello console, World!\");Console.Write(\"Press a key to continue...\");Console.Read();\nThis makes the console beep, changes its title and writes some suitable messages.\nThere is one small subtle \"gotcha\" that you need to keep in mind.\nIf you generate the console yourself then the user cannot redirect input/output from/to a file.\nThat is, if your application is MyApp.exe then\nMyApp > MyTextFile.txt\nworks if MyApp is a console application but doesn't work if you create the console.\nWhat you have to do in this case is detect the arguments \"> MyTextFile.txt\" when your application creates the console. For example, to redirect the output file you would use:\npublic void MakeConsole(){ if (!AttachConsole(ATTACH_PARENT_PROCESS)) { AllocConsole(); }; string[] cmd=Environment.GetCommandLineArgs(); if (cmd[1] == \">\") { Console.Write(cmd[2]); FileStream fs1=new FileStream(cmd[2], FileMode.Create); StreamWriter sw1=new StreamWriter(fs1); Console.SetOut(sw1); }}\nThis uses the Environment object to retrieve the command line arguments and then tests for an output redirection in cmd[1].\nIf it finds a \">\" it then creates a FileStream and then a StreamWriter which it sets the standard output to.\nFrom this point on everything sent to the Console is stored in the file. The only complication is that you have to remember to close the file when the application is finished with the console. For example:\nConsole.Title=\"My Console\";Console.Out.Close();\nOf course a better design would be to put the Out.Close in a finalise method.\nYou can write similar code to redirect the standard input stream and even to form pipes and interpret other strange command line syntax. [ ... ]"},"url":{"kind":"string","value":"http://i-programmer.info/programming/c/1039-using-the-console.html"},"dump":{"kind":"string","value":"CC-MAIN-2018-17"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":235,"cells":{"text":{"kind":"string","value":"Documentation\nPublic Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members\nUrho3D::Material Class Reference\nDescribes how to render 3D geometries. More...\n#include \nInheritance diagram for Urho3D::Material:\nCollaboration diagram for Urho3D::Material:\nDetailed Description\nDescribes how to render 3D geometries.\nMember Function Documentation\nLoad resource from stream. May be called from a worker thread. Return true if successful.\nReimplemented from Urho3D::Resource.\nHere is the call graph for this function:\nThe documentation for this class was generated from the following files:\n- /home/travis/build/urho3d/Urho3D/Source/Urho3D/Graphics/Material.h\n- /home/travis/build/urho3d/Urho3D/Source/Urho3D/Graphics/Material.cpp"},"url":{"kind":"string","value":"https://urho3d.github.io/documentation/1.5/class_urho3_d_1_1_material.html"},"dump":{"kind":"string","value":"CC-MAIN-2018-17"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":236,"cells":{"text":{"kind":"string","value":"KinoSearch::Plan::FullTextType - Full-text search field type.\nThe KinoSearch code base has been assimilated by the Apache Lucy project. The \"KinoSearch\" namespace has been deprecated, but development continues under our new name at our new home:\nmy $polyanalyzer = KinoSearch::Analysis::PolyAnalyzer->new( language => 'en', ); my $type = KinoSearch::Plan::FullTextType->new( analyzer => $polyanalyzer, ); my $schema = KinoSearch::Plan::Schema->new; $schema->spec_field( name => 'title', type => $type ); $schema->spec_field( name => 'content', type => $type );\nKinoSearch::Plan::FullTextType is an implementation of KinoSearch::Plan::FieldType tuned for \"full text search\".\nFull text fields are associated with an Analyzer, which is used to tokenize and normalize the text so that it can be searched for individual words.\nFor an exact-match, single value field type using character data, see StringType.\nmy $type = KinoSearch::Plan::FullTextType->new( analyzer => $analyzer, # required boost => 2.0, # default: 1.0 indexed => 1, # default: true stored => 1, # default: true sortable => 1, # default: false highlightable => 1, # default: false );\nIndicate whether to store data required by KinoSearch::Highlight::Highlighter for excerpt selection and search term highlighting.\nAccessor for \"highlightable\" property.\nKinoSearch::Plan::FullTextType isa KinoSearch::Plan::TextType isa KinoSearch::Plan::FieldType isa KinoSearch::Object::Obj.\nThis program is free software; you can redistribute it and/or modify it under the same terms as Perl itself."},"url":{"kind":"string","value":"http://search.cpan.org/~creamyg/KinoSearch-0.315/lib/KinoSearch/Plan/FullTextType.pod"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":237,"cells":{"text":{"kind":"string","value":"So what I started thinking about was how I would want to go about designing portable code that takes ObjC into account but is not limited to platforms that support ObjC. Obviously I need to write much of the code in a language other than ObjC if this is the goal. One simple way is to write all the busy code in C and use pre-compiler directives to build with either ObjC or C where the code touches the required interfaces (GUI and such.) I'm not really keen on that idea because I would like to start with an object-oriented design and build an implementation with sensible classes. That leads me to Objective-C++ and I think it is not only a good answer but a powerful one. The reason I say that is I should be able to apply design patterns as needed and apply good object-oriented design to the whole project without worrying about the portability of my classes.\nMy ultimate goal is to write most of the code in C++ and provide C++ interfaces that can be implemented where a platform implementation is needed and the proper instantiation would be obtained from class factories. This is a fairly common object-oriented design approach. Thinking about a GUI, specifically, the idea is to be able to implement GUI classes to an interface so that the application is GUI implementation neutral. It wouldn't care if the implementation were GTK, Qt, Cocoa, etc. And ultimately it wouldn't care if the implementation is in Objective-C.\nThe problem then is implementing those C++ interfaces with Objective-C classes. All Objective-C++ is, essentially, is the Objective-C language built with a C++ compatible compiler (g++, etc). Nothing was done to create compatibility between the two class types. C++ classes can contain ObjC elements and ObjC classes can contain C++ elements. What you can't do is extend or implement a C++ class with an Objective-C class and vice versa. You can't cast between the two class types obviously. So I decided the first solution is essentially to use bridges which is what I'm going to demonstrate here. The idea is that I have a C++ interface that is implemented by an Objective-C class. Obviously the ObjC class can't inherit from the interface so it inherits from NSObject or a child of it. The thing that binds the ObjC implementation to the C++ interface is a C++ bridge class that implements the interface. The bridge contains the ObjC implementation which is allocated when the bridge is constructed and destroyed when the bridge is destructed. All calls into the bridge are directed into the ObjC class. This is very simple and quite effective. You can pass the C++ bridge into methods that accept the interface and they are none the wiser.\nSo I have posted a lot of information just to show something that is really incredibly simple. My main goal here is to get feedback on how this could be improved, if there are other methods that might be better, and what pitfalls could be looming. This example does not consider the handling of exceptions in any way. That is something I have not dug into yet. It does not demonstrate passing C++ references though that should work. I would like to experiment with that more. One of the things I am thinking about is how the bridge could be built with macros so that the developer can simply build the Objective-C interface and issue a macro for the class and each method implemented so that there aren't a bunch of bridge headers hanging about. If anyone has some ideas on that it would be great to see. I am pretty sure I could slap some macros together pretty easily but, again, the exceptions are something to think about.\nAnyway, here is an example of what I have done so far. Like I said, this is not complicated and it works very well.\nHere is a UML class diagram for the three important players here:\nSo the first thing I need to code up is that C++ interface and here it is:\n// // CppInterface.h // TestCppInterface // #ifndef TestCppInterface_CppInterface_h #define TestCppInterface_CppInterface_h class CppInterface { public: virtual ~CppInterface() {}; virtual void methodA() = 0; virtual void methodB() = 0; virtual int value() const = 0; virtual void setValue(int value) = 0; }; #endif\nAlright. So this is a common C++ interface. Nothing special here.\nNext would be implementing the interface with an Objective-C class. Obviously, as already stated, I can't inherit from this interface so I will implement the interface but inherit from NSObject. (A little bit of expanded thought... this could actually be an Objective-C interface itself and the bridge could actually be used for multiple ObjC implementations which could be handled by the class factory.)\nHere is the declaration:\n// // CppInterfaceImpl.h // CppInterface // #import @interface CppInterfaceImpl : NSObject { int value; } @property int value; -(void) methodA; -(void) methodB; @end\nHere is the definition:\n// // CppInterfaceImpl.m // CppInterface // #import #import \"CppInterfaceImpl.h\" @implementation CppInterfaceImpl @synthesize value; -(void) methodA { NSLog(@\"Called %s\", __FUNCTION__); } -(void) methodB { NSLog(@\"Called %s\", __FUNCTION__); } @end\nNotice I did not use the .mm extension for this source. It is not necessary for this class but it COULD be for a different one. It might be a good decision to just say all ObjC sources will use the .mm extension in this kind of project so there is no worry about a code or interface change forcing a file extension change.\nSo I used the features of the language for the getter and setter methods. Otherwise it looks pretty much how you would expect an implementation of the interface to look.\nNow for the glue in the middle. The bridge is very simple:\n// // CppInterfaceOCBridge.h // TestCppInterface // #ifndef TestCppInterface_CppInterfaceOCBridge_h #define TestCppInterface_CppInterfaceOCBridge_h #include \"CppInterface.h\" #import \"CppInterfaceImpl.h\" class CppInterfaceOCBridge : public CppInterface { public: CppInterfaceOCBridge(); virtual ~CppInterfaceOCBridge(); virtual void methodA(); virtual void methodB(); virtual int value() const; virtual void setValue(int value); private: CppInterfaceImpl* m_OCObj; }; inline CppInterfaceOCBridge::CppInterfaceOCBridge() { m_OCObj = [[CppInterfaceImpl alloc] init]; } inline CppInterfaceOCBridge::~CppInterfaceOCBridge() { [m_OCObj release]; } inline void CppInterfaceOCBridge::methodA() { [m_OCObj methodA]; } inline void CppInterfaceOCBridge::methodB() { [m_OCObj methodB]; } inline int CppInterfaceOCBridge::value() const { return [m_OCObj value]; } inline void CppInterfaceOCBridge::setValue(int value) { [m_OCObj setValue: value]; } #endif\nWith that we are ready to instantiate an Objective-C class as a CppInterface. I created an Objective-C main that does that. While I have been mentioning class factories I did not actually use one in the example. The main is just going to instantiate the bridge and exercise it:\n// // main.mm // TestCppInterface // #import #include \"CppMain.h\" #include \"CppInterfaceOCBridge.h\" int main (int argc, const char * argv[]) { @autoreleasepool { CppInterface *a = new CppInterfaceOCBridge; NSLog(@\"Calling C++ methods from within Objective-C!\"); a->methodA(); a->methodB(); a->setValue(5); NSLog(@\"Value is %i\", a->value()); CppMain cppMain(*a); cppMain.run(); delete a; } return 0; }\nI wanted to go ahead and try passing this class into a method of a plain C++ class that has no ObjC in it (and uses the .cpp extension) so I created the CppMain class and you can see it exercised there. Here is that class:\n// // CppMain.h // TestCppInterface // #ifndef TestCppInterface_CppMain_h #define TestCppInterface_CppMain_h #include \"CppInterface.h\" class CppMain { public: CppMain(CppInterface& interface); ~CppMain(); void run(); private: CppInterface& m_Interface; }; #endif\n// // CppMain.cpp // TestCppInterface // #include #include \"CppMain.h\" using namespace std; CppMain::CppMain(CppInterface& interface) : m_Interface(interface) { } CppMain::~CppMain() { } void CppMain::run() { cout << \"Running from CppMain!\" << endl; m_Interface.methodA(); m_Interface.methodB(); m_Interface.setValue(28); cout << \"Value is \" << m_Interface.value() << endl; }\nYou might notice a terrible practice in this code related to pointers and reference storing. It was just an experiment. It's going to be okay. So here we can see what we ultimately really want in work. Since most of the code will be C++ and C++ class references will be getting tossed around it is the ability to call the Objective-C class from an unaware C++ class that fulfills the goals of the experiment.\nHere is the output when I run this application:\n2012-01-16 17:13:20.170 TestCppInterface[8480:707] Calling C++ methods from within Objective-C! 2012-01-16 17:13:20.173 TestCppInterface[8480:707] Called -[CppInterfaceImpl methodA] 2012-01-16 17:13:20.174 TestCppInterface[8480:707] Called -[CppInterfaceImpl methodB] 2012-01-16 17:13:20.175 TestCppInterface[8480:707] Value is 5 Running from CppMain! 2012-01-16 17:13:20.175 TestCppInterface[8480:707] Called -[CppInterfaceImpl methodA] 2012-01-16 17:13:20.176 TestCppInterface[8480:707] Called -[CppInterfaceImpl methodB] Value is 28 Program ended with exit code: 0\nIt is very easy to find the C++ output because, unlike the ObjC output, it does not get timestamped.\nSo as I said, I'm looking to expand on this and see how it might be streamlined for use in a large project. If anyone is aware of another way to achieve the stated goals I would love to see what you have come up with. I think what I have done here has to be one of the first ideas anyone going down this road would consider. I think I will be messing with some ideas for macros in the next few days and I will show what I have come up with at that point. I also am really interested in delving into error handling and supporting exceptions.\nThanks for looking."},"url":{"kind":"string","value":"http://www.dreamincode.net/forums/topic/263167-implementing-c-interfaces-with-objective-c-classes/page__pid__1532348__st__0"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":238,"cells":{"text":{"kind":"string","value":".\n301\n+ Dirkiller on February 16th, 2012 at 4:39 am said:\n… AND I NEED ON PLEASE!!!!\n302\n+ Dirkiller on February 16th, 2012 at 4:40 am said:\n… AND I NEED TWISTED METAL – HEAD ON PLEASE!!!!\n303\n+ Garylisk on February 16th, 2012 at 8:40 am said:\nCrisis Core + Kindgom Hearts plz.\n304\n+ Chevy_Is_Life on February 16th, 2012 at 12:23 pm said:\nGrand Theft Auto Vice City Stories & China Town Wars! D:\n305\n+ unliving-12 on February 16th, 2012 at 8:13 pm said:\ni want Patapon 3 to be Vita ready!!! i was looking forward to playing it on the vita but it’s not ready yet :(\nwill games become vita ready in big waves? what i mean is, a bunch becoming vita ready at a time? or what\n306\n+ KillingSpree0 on February 16th, 2012 at 11:07 pm said:\nPlease put kingdom hearts birth by sleep on psn quick!\n307\n+ togue on February 17th, 2012 at 2:24 pm said:\nI was able to move my digital Gran Turismo PSP game to the PSVITA and it isn’t on the list. Just an FYI for others who are curious\n308\n+ Kamandol on February 17th, 2012 at 7:03 pm said:\nAdd WTF: Work Time Fun please. That game was insane.\n309\n+ ProFrothegreat on February 18th, 2012 at 9:11 am said:\nProbably been said, but I thought it was funny that most of the most wanted games (LBP, Modnation, MGS:PW) have vita versions out or coming soon. Thinking that these games will hit after those versions have had a bit of time on the market.\n310\n+ Hope_Estheim on February 18th, 2012 at 1:18 pm said:\nI don’t know if it has been mentioned yet, but Patapon 1 & 3 are not on the list. I guess I can understand on having Patapon 1 on there, but Patapon 3 definitely should be! Just pointing that out!\n311\n+ Adactus on February 18th, 2012 at 9:47 pm said:\nKH: Birth by Sleep as well as both of the Star Ocean games ASAP. Please and Thank You.\n312\n+ unliving-12 on February 19th, 2012 at 11:34 am said:\nyea i agree, patapon 3 is the best one imo by a LONG shot\n313\n+ JRMONEYSTAKZ on February 19th, 2012 at 3:22 pm said:\nI’ve redownloaded a bunch of minis I had on the list but when I use content manager nothing showed up. None of them are installed on ps3 just downloaded. This sucks any help?\n314\n+ LegendarySzoke on February 19th, 2012 at 5:13 pm said:\nHoping like heck that NFS Carbon, Tron Evolution, Marvel Ultimate Alliance and Star Wars Battlefront Elite Squadron join this list soon.\n315\n+ TROOPER265 on February 20th, 2012 at 6:10 am said:\nOkay, you guys are going to love this. I downloaded Star Wars Battlefront II to my Playstation 3 and then with the cable installed it to my PSP AND IT WORKS! It’s not one of the games that’s on list.\nthen do what ParkingtigersX posted here:\n”.”\nAlso on this menu is a way to adjust the right joystick for PSP GAMES.\nI wonder how many other games that aren’t listed can be downloaded per the PS3 that aren’t available on the Vita PSN STORE that work?\n316\n+ mrkojoko on February 20th, 2012 at 6:25 pm said:\ndef jam fight for ney york the takeover\nplease dont forget to add it :)\n317\n+ Fylian on February 21st, 2012 at 7:02 am said:\nI can’t seem to get Age of Zombies to copy to my Vita. I tried Content Manager through my PS3, PSN store on my Vita and even my downloads list on the Store. Please remedy this bc i am dying to play using the dual analog. Thanks\n318\n+ ShadowNextGen on February 22nd, 2012 at 7:08 pm said:\nSo…Sony has already screwed over their fan base by not giving us access to the UMD transfer program. Now there are games that I bought digitally over PSN that I can’t put on the Vita? Are you serious? Is this an early April Fool’s foke?\n319\n+ LIZZ1ER0SE on February 22nd, 2012 at 7:24 pm said:\nDear sony, how about releasing five emulated PSP games every day instead of 275 games in god knows how long? Cheers.\n320\n+ foxdarterx on February 22nd, 2012 at 8:00 pm said:\ncrisis core? please\n321\n+ jncasanova on February 22nd, 2012 at 8:01 pm said:\nI see some titles here and in the PSVita section of the PS3 store that can’t be copied to my PSVita!\nOne example is Age of Zombies, it’s not even available in the PSVita store.\nCould anyone tell me how you did to copy these games??\n322\n+ unliving-12 on February 22nd, 2012 at 10:41 pm said:\ni really wanna play my psp games on my vita\n323\n+ ItaChu on February 23rd, 2012 at 3:35 am said:\n@jncasanova same here man I cant download Age of Zombies minis …. and the vita cant even see ANY of the minis on my PS3 to copy them to the Vita …. looks like they need to update the Vita\n324\n+ Dratsabius on February 23rd, 2012 at 4:53 am said:\nSadly (for me anyway) I recently bought the digital version of Final Fantasy IV: The Complete Collection in anticipation of playing it on Vita.\nIt is on my PS3 XMB but it will not copy to Vita. I have also tried to redownload it on the Vita itself. No dice.\nWhat a pity that the supported games (according to the list provided) actually don’t work at all.\n:(\n325\n+ BigPoppaChunk on February 23rd, 2012 at 6:22 am said:\nthere are a bunch of minis on the list that dont work age of zombies, i must run, lets golf, vempire.\nand alot not on the list that do work\nlittle big planet\nmadden 2010\nwwe 2009\nunbound saga\ncapcom classics\ngijoe\npeggle\nbejewelled 2\nevery day shooter\nsuper stardust portable\nking of pool\npuzzle quest\nsavage moon\nfinal fantasy crystal defenders\nthese all work by downloading them to your ps3 and keeping them in bubble form then plugging in your ps vita into ur ps3 and transferring them via content manager.\nPLEASE add your games that work that are not on the list and any on the list that dont work aswell!!!\n326\n+ BigPoppaChunk on February 23rd, 2012 at 8:39 am said:\nkillzone liberation works\n327\n+ ninjaluke84 on February 23rd, 2012 at 9:09 am said:\nI know that they will update this list with games currently on the psn. However I sure would like Kingdom Hearts Birth By Sleep to be added to psn and made vita compatible.\n328\n+ suchti2404 on February 23rd, 2012 at 11:03 am said:\nIn germany no Assasains Creed Bloodlines\nand no Monster hunter freedom unite camey to the release how it is in other lands?\n329\n+ jncasanova on February 23rd, 2012 at 1:42 pm said:\nI was able to copy and play:\nLittle Big Planet PSP (even with add ons)\nAuditorium\nAssassins Creed Bloodlines\nStar Wars Clone Wars Republic Heroes\nLocoRoco Midnight Carnival\nI think maybe they didn’t write Little Big Planet PSP and Super Stardust PSP because there are newer versions comming.\nHope my Tetris and Angry Birds minis work on my Vita soon but I guess there will have to be a Firmware Update for that.\n330\n+ Kmedina1 on February 23rd, 2012 at 3:00 pm said:\nwhat about dragonball z tenkaichi tag team and shin budokai another road and naruto games come on their so fun i need those games\n331\n+ ggerry72 on February 23rd, 2012 at 4:22 pm said:\nwhen will patapon 3 be available?\n332\n+ unliving-12 on February 23rd, 2012 at 5:21 pm said:\nyea why did they make patapon 2 compatible but not 3 -_-\n3 is so much better, awesome game\n333\n+ solo013 on February 23rd, 2012 at 6:58 pm said:\nI’m not sure why, but a lot of the minis on this list are not showing up in the store on my vita itself. However, I do see them in the ps3s store under the vita section.\nI also have LittleBigPlanet PSP showing up in my PS3 to Vita transfer management for anyone wanting to try that one out on the Vita.\n334\n+ X138999 on February 23rd, 2012 at 7:07 pm said:\nI noticed Age of Zombies is on the list but I can’t get it on Vita’s Store. Is it still possible to get it from the PS3? And why are certain titles highlighted?\n335\n+ solo013 on February 23rd, 2012 at 8:12 pm said:\n@334 I just tried Age of Zombies and about 20 others showing up in the PS3 store under the Vita section, and none of them will show up in the content management app. Only the Minis in the store on the Vita itself seem to be available.\nI’m glad I noticed this too, because I was going to buy several I saw on the PS3’s Vita section to have a few extra things to play on the Vita.\n336\n+ Teflon02 on February 23rd, 2012 at 9:20 pm said:\nAnyone know if the PSP Sega Genesis collection works? Thanks in advance I’m getting My Vita on the 29th so i cant check myself\n337\n+ Dratsabius on February 24th, 2012 at 1:33 am said:\nFor the record, I tried to copy Final Fantasy IV to the Vita from my PS3 again last night and this time it worked!!! It is now on Vita and working flawlessly!\nI also tried to copy Valkyria Chronicles 2 across and it failed on the first attempt. I tried a second time and it worked fine.\nLooks like the copy mechanism is a little wonky, but it does work with some persistance.\nAnyway – I (mostly) take back my snarky comment of yesterday.\nHugs n kisses Sony :)\n338\n+ killer0881 on February 24th, 2012 at 8:31 am said:\nThe best games aren’t available for vita yet, like Crisis Core, or any of the resistance or killzone titles for psp. The 2 GOW games are available but i already have the collection for PS3, so i have no interest.\n339\n+ NoleHater on February 24th, 2012 at 8:33 am said:\nI know a couple more games that are not on this list that will play on the vita. Grand Theft Auto Vice City Stories, Kill Zone Liberation, Pinball Hereos, Metal Gear Solid Peace Walker\n340\n+ NoleHater on February 24th, 2012 at 8:34 am said:\nI know a couple more games that are not on this list that will play on the vita. Grand Theft Auto Vice City Stories, Kill Zone Liberation, Metal Gear Solid Peace Walker,and Pinball Heroes\n341\n+ killer0881 on February 24th, 2012 at 8:41 am said:\nI didn’t know killzone liberation would work, i should be able to “redownload at no extra cost” then.\n342\n+ dq5209 on February 24th, 2012 at 3:25 pm said:\ngta liberty city stories works and all you need is a ps3\n343\n+ RaziiJinx on February 24th, 2012 at 4:59 pm said:\nI Must Run! mini does not show up on PSN nor in the Content Manager to download to Vita. And yes, I have re-downloaded it on my PS3 as well.\n344\n+ BD-S-I-C on February 24th, 2012 at 7:54 pm said:\nThey really really need to make all psp titles compatible. I have only ever purchased 2 psp titles from PSN:\nMortal Kombat Unchained\nManhunt 2\nNeither of these titles are compatible…..come on sony…\n345\n+ malkuth3 on February 25th, 2012 at 3:24 am said:\nThis sucks ass!! Should’ve come here before I spent hours in front of my PC trying to transfer my PSP games to my Vita! This is so stupid! Something like this should be very easy especially if you have Media Go and a valid PSN account!! I also discovered that I can’t transfer most of my music to my Vita as well (no, I don’t own any pirated downloads!!)! even though they are all either CD copies or iTunes! Why? I have the Content Asst activated but my Media Go is not recognizing my Vita?!\n346\n+ juggalotus53 on February 25th, 2012 at 6:17 am said:\nplease say that Silent Hill: Origins will be one of the psp titles that will be playable on Vita\n347\n+ adray69 on February 25th, 2012 at 6:43 am said:\n@346 I can confirm that silent hill origin is indeed compatible\n@345 the reason it won’t let you copy from itunes is because music from itunes has drm added to it. If it’s just a regular mp3 that you’ve copied from a cd than it shouldn’t have any problem copying to you vita.\n348\n+ freewillgnome on February 25th, 2012 at 5:46 pm said:\nIs there any news as to whether patapon 3 is going to be able to be played on the vita, and if so if it will be within the near future, because they already have patapon 2 and i would really like to have number 3 as well!\n349\n+ sithlord9 on February 26th, 2012 at 8:44 am said:\nis it possible that this list only applies for US games / PSN accounts?\nI downloaded Syphon Filter: Logan’s Shadow on the PS3 (vita does not allow me) but cannot see it in the content manager.\nOn the contrary I got Resistance downloaded via the Vita. Also Tron could be copied via PS3.\n350\n+ sithlord9 on February 26th, 2012 at 8:50 am said:\nTo add to my earlier comment and while waiting for an official sony reply a quick question for those that got Killzone working:\nAre you guys talking about the EU or US version?\nMaybe we should all state which territory we are from. In my case i got to run the Germany/Europe-versions of\n– Resistance\n– Tron (only via PS3)\n– NOVA\n– Warhammer 40k\n– Force Unleashed\n– Obscure\n– Worms Battle Islands\nI could not get to run (not downloadable via vita / not seen in content manager):\n– Star Wars Battlefront Renegade Squadron\n– Syphon Filter: Logan’s Shadow"},"url":{"kind":"string","value":"http://blog.us.playstation.com/2012/02/09/how-to-download-psp-titles-to-ps-vita/comment-page-7/"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":239,"cells":{"text":{"kind":"string","value":", \"Running and Testing EJB/JPA Components\"\nJDeveloper includes step-by-step wizards for creating EJB projects, entities, persistence units, session beans, and message-driven beans. You can build entities from online or offline database definitions and from application server data source connections. There is also seamless integration with JPA and TopLink technology to provide a complete persistence package.\nJDeveloper supports EJB 3 the need for home and component interfaces and the requirement for bean classes for implementing\njavax.ejb.EnterpriseBean interfaces. The EJB bean class can be a pure Java class (POJO), and the interface can be a simple business interface. The bean class implements the business interface.\nUse of Annotations Instead of Deployment Descriptors - Metadata annotation is an alternative to deployment descriptors. Annotations specify bean types, different attributes such as transaction or security settings, O-R mapping and injection of environment or resource references. Deployment descriptor settings override metadata annotations.\nDependency Injection - The API for lookup and use of EJB environment and resource references is simplified, and dependency injection is used instead. Metadata annotation is used for dependency injection.\nEnhanced Lifecycle Methods and Callback Listener Classes - Unlike previous versions of EJB, you do not have to implement all unnecessary callback methods. Now you designate any arbitrary method as a callback method to receive notifications for lifecycle events. A callback listener class is used instead of callback methods defined in the same bean class.\nInterceptors - An interceptor is a method that intercepts a business method invocation. An interceptor method is defined in a stateless session bean, stateful session bean, or a message-driven bean. An interceptor class is used instead of defining the interceptor method in the bean class.\nSimple JNDI Lookup of EJB - Lookup of EJB is simplified and clients do not have to create a bean instance by invoking a\ncreate() method on EJB and can now directly invoke a method on the EJB.\nSimplified Beans - Session beans are pure Java classes and do not implement\njavax.ejb.SessionBean interfaces. The home interface is optional. A session bean has either a remote, local, or both interfaces and these interfaces do not have to extend\nEJBObject or\nEJBLocalObject.\nMetadata Annotations - Metadata annotations are used to specify the bean or interface and run-time properties of session beans. For example, a session bean is marked with\n@Stateless or\n@Stateful to specify the bean type.\nLifecycle Methods and Callback Listeners - Callback listeners are supported with both stateful and stateless session beans. These callback methods are specified using annotations or a deployment descriptor.\nDependency Injection - Dependency injection is used either from stateful or stateless session beans. Developers can use either metadata annotations or deployment descriptors to inject resources, EJB context or environment entries.\nInterceptors - Interceptor methods or interceptor classes are supported with both stateful and stateless session beans.\nMessage-Driven Beans (MDBs)\nSimplified Beans - Message-driven beans do not have to implement the\njavax.ejb.MessageDriven interface; they implement the\njavax.jms.MessageListener interface.\nMetadata Annotations - Metadata annotations are used to specify the bean or interface and run-time properties of MDBs. For example, an MDB is marked with\n@MessageDriven for specifying the bean type.\nLifecycle Methods and Callback Listeners - Callback listeners are supported with MDBs. These callback methods are either specified using annotations or the deployment descriptor.\nDependency Injection - Dependency injection is used from an MDB. You either use metadata annotations or deployment descriptors to inject resources, EJB context, or environment entries used by an MDB.\nInterceptors - Interceptor methods or interceptor classes can be used with MDBs.\nEntities - Java Persistence API (JPA)\nSimplified Beans (POJO Persistence) - EJB 3.0 greatly simplifies entity beans and standardizes the POJO persistence model. Entity beans are concrete Java classes and do not require any interfaces. The entity bean classes support polymorphism and inheritance. Entities can have different types of relationships, and container-managed relationships are manually managed by the developer.\nEntity Manager API - EJB 3.0 introduces the\nEntityManager API that is used to create, find, remove, and update entities. The\nEntityManager API introduces the concept of detachment/merging of entity bean instances similar to the Value Object Pattern. A bean instance may be detached and may be updated by a client locally and then sent back to the entity manager to be merged and synchronized with the database.\nMetadata Annotations - Metadata annotations greatly the query capability for entities with Java Persistence Query Language (JPQL). JPQL enhances EJB-QL by providing additional operations such as bulk updates and deletes, JOIN operations, GROUP BY HAVING, projection and sub-queries. Also dynamic queries can be written using EJB QL.\nLifecycle Methods and Callback Listeners - Callback listeners are supported with entity beans. Callback methods are either specified using annotations or a deployment descriptor.\nJDeveloper includes a complete set of features to set up the EJB business layer of an enterprise application.\nYou can start by using the step-by-step wizard to create the framework for your EJB web application, setting up the model layer of your enterprise application. You can then use wizards to create entities that correspond to database tables. You can then use a wizard to create session beans and facades and to build a persistence unit. Oracle ADF provides components to enable data controls. When you are ready, you can use the JDeveloper integrated server capabilities to test it.\nJDeveloper includes tools for developing EJB applications, as described in the following sections.\nSection 12.3.1.1, \"Creating Entities\"\nSection 12.3.1.2, \"Creating Session Beans and Facades\"\nSection 12.3.1.3, \"Deploying EJBs\"\nSection 12.3.1.4, \"Testing EJBs Remotely\"\nSection 12.3.1.5, \"Registering Business Services with Oracle ADF Data Controls\"\nUse the entity wizards to create entities or to create entities from tables using online, offline, or application server data source connections. Use the Entity Beans from Tables Wizard to reverse-engineer entities from database tables. In the entity wizards you can select or add a.7.1, \"Using Session Facades\".\nWhen you create a session bean with the wizard, you have the option of generating session facade methods for every entity in the same project. You can choose which core transactional methods to generate,\nget() and\nset() accessors, and finder methods on the entities. If you create new entities or new methods on entities, you can update your existing session facade by right-clicking it in the Navigator and choosing Edit Session Facade.\nJDeveloper provides Oracle WebLogic Server as a container for deployed EJBs. A JDeveloper server-specific deployment profile is generated by default. You can also create a WebLogic-specific deployment profile. For more information, see Section.2, \"How to Test EJB/JPA Components Using a Remote Server\".\nADF provides components for enabling data controls for your entities. Your Java EE application integrates selective components as you manually add a data control for your entities. For more information, see \"Using ADF wizard.\nWhen you get to the EJB Name and Options page, be sure to check Generate Session Facade Methods.This automatically adds the session facade methods to your session bean. Note that you can create and edit session facade methods for all entities in your project by right-clicking your session bean and choosing Edit Session Facade. JDeveloper automatically recognizes new entities in your project and new methods on the entities.\nTo register the business services model project with the data control:\nRight-click your session bean in the Navigator and choose Create Data Control.\nThis creates a file called\nDataControls.dcx which contains information to initialize the data control to work with your session bean.\nTo run and test your application:\nYou have now created the basic framework for the model layer for a web-based EJB application. Use this framework to test your application as you continue building it. For more information, see Section 12.10, \"Running and Testing EJB/JPA Components\".\nTo deploy your application:\nThe integrated server runs within JDeveloper. You can run and test EJBs using this server and then deploy your EJBs with no changes to them. You do not need to create a deployment profile to use this server, nor do you have to initialize it. Create the deployment descriptor,\nejb-jar.xml using the Deployment Descriptor wizard, and then package your EJB modules for deployment with your application.\nThe Java EE design patterns are a set of best practices for solving recurring design problems. Patterns are ready-made solutions that can be adapted to different problems, and leverage the experience of successful Java EE developers.\nJDeveloper can help you implement the following Java EE design patterns in your EJB applications:\nMVC - The MVC pattern divides an application into three parts, the Model, View, and Controller. The model represents the business services of the application, the view is the portion of the application that the client accesses, the controller controls the flows and actions of the application and provides seamless interaction between the model and view. The MVC pattern is automatically implemented if you choose the Fusion Web Application (ADF) or Java EE Web Application template when you begin your project.\nSession Facade - The session facade pattern contains and centralizes complex interactions between lower-level EJBs (often JPA entities). It provides a single interface for the business services of your application. For more information, see Section 12.7, \"Implementing Business Processes in Session Beans\".\nBusiness Delegate - The business delegate pattern decouples clients and business services, hiding the underlying implementation details of the business service. The business delegate pattern is implemented by the data control, which is represented in JDeveloper by the Data Control Palette. For more information, see \"Using ADF is defined in the Java Persistence API.\nJPA entities adopt a lightweight persistence model designed to work seamlessly with Oracle TopLink and Hibernate.\nThe major enhancements with JPA entities are:\nJPA Entities are POJOs\nMetadata Annotations for O-R Mapping\nInheritance and Polymorphism Support\nSimplified EntityManager API for CRUD Operations\nQuery Enhancements\nJPA entities are now POJOs (Plain Old Java Objects) and there are no component interfaces required for them. JPA entities support inheritance and polymorphism as well.\nExample 12-1 contains the source code for a simple JPA entity.\nExample 12-1 Source code for a simple JPA entity\n; } ... }\nNote that the bean class is a concrete class, not an abstract one, as was the case with CMP 2.x entity beans.\nThe O-R mapping annotations allow users to describe their entities with O-R mapping metadata. This metadata is then used to define the persistence and retrieval of entities. You no longer have to define the O-R (object Relational) mapping in a vendor-specific descriptor.\nThe example above uses the\n@Entity,\n@Table, and\n@Column annotations to specify at the class level that this is an entity, and to specify the underlying database table and column names for the entity. You can also use mapping annotations to define a relationship between entities, as shown in Example-3 Joined Subclass { ... }\nThe\njavax.persistence.EntityManager API is used for CRUD (Create, Read, Update, and Delete) operations on entity instances. You no longer have to write code for looking up instances and manipulating them. You can inject an instance of EntityManager in a session bean and use\npersist() or\nfind() methods on an EntityManager instance to create or query entity bean objects, as show in Example 12-4.\nExample 12-4 EntityManager in a Session Bean\n@PersistenceContext); } }\nQueries are defined in metadata. You may now specify your queries using annotations, or in a deployment descriptor. JPA entities support bulk updates and delete operations through JPQL (Java Persistence Query Language). For more information, see Section 12.6.7, \"JDK 5 Annotations for EJB/JPA\".\nJDeveloper offers you two easy wizards to create your JPA entities. You can create entities from online or offline databases, add a persistence unit, define inheritance strategies, and select from available database fields. The Entity from Tables wizard allows you to create entities from online or emulated offline databases, as well as from.\nJDeveloper provides support for the SDO (Service Data Objects) data application development framework.\nUse the SDO 2.0 framework and API to easily modify business data regardless of how it is physically accessed. SDO encapsulates the backend data source, offers a choice of static or dynamic programming styles, and supports both connected and disconnected access. SDO handles XML parser operations, and automatically integrates the data parsing logic with the application. For more information, \"Integrating Service-Enabled Application Modules\" in patterns and best practices\nSDO is a unified framework for data application based on the concept of disconnected data graphs. A data graph is a collection of tree-structured or graph-structured data objects. To enable development of generic or framework code that works with Data Objects, it is important to be able to introspect on Data Object metadata, which exposes the data model for the Data Objects. As an alternative to Java reflection, SDO provides APIs to access metadata stored in XML schema definition (XSD) files that you create, based on the entity or data model information detailed in your EJB session beans.\nThe SDO feature in JDeveloper can be used as an EJB service or as an ADF-BC service. If you choose to use an ADF-BC service you need add the listener reference to your\nweblogic-application.xml file. For more information, see Section 12.6.5, \"How to Create an SDO Service Interface for JPA Entities\".\nFor more information and specifications on SDO, see the OSOA (Open Service Oriented Architecture) at\nYou can easily create a service interface API to access JPA entity data through either an EJB session bean or a plain old Java object (POJO). This service class exposes operations for creating, retrieving, updating, and deleting the JPA entities in your JDeveloper J2EE application.\nTo create a SDO service interface:\nStart with an EJB session bean, or an ordinary Java class (POJO), that exposes CRUD methods for one or more JPA entities.\nYou can use the wizard to create your session beans. For more information, see Section 12.7.2, \"How to Create a Session Bean\".\nIn the Structure window, right-click your EJB session Bean or POJO and choose Create Service Interface.\nSelect the methods you want to make available in your service API.\nBy default all of the methods in your session bean interface are selected. Click the checkbox to select or unselect a method.\nIn this release, when you create a service interface, your original session bean file and the remote (or local) interface are modified. New methods are added that match the original ones, but they reference newly defined SDO data objects instead of JPA entities. These SDO data objects match the JPA entities and are defined in XSD files, which are also added to your project, and their names are appended with SDO, such as\nDeptSDO or\nEmployeeSDO. Select Backup File(s) to create a backup of your original session bean file.\nClick OK.\nTo use an EJB/POJO SDO ADF-BC service from a fabric composite using SDO external bindings, you need to set up the Weblogic application deployment listener to invoke the\nServiceRegistry logic. Set this up by adding the listener reference to your\nweblogic-application.xml file.\nTo add the listener reference:\nAdd the code in Example 12-5 to the\nweblogic-application.xml which by default is located in\n/src/META-INF.\nExample 12-5 Code Added to weblogic-application.xml\n oracle.jbo.client.svc.ADFApplicationLifecycleListener \nOnce this listener is added, JDeveloper automatically registers the SDO service application name\n_JBOServiceRegistry_ into the fabric service registry in the\ncomposite.xml.\nWhen you create your SDO service interface, the necessary files to support your service interface are automatically created. These files include the following:\nSessionEJBBeanWS.wsdl - This file describes the capabilities of the service that provides an entry point into an SOA application or a reference point from an SOA application. The WSDL file provides a standard contract language and is central for understanding the capabilities of a service.\nSessionEJBBeanWS.xsd - This is an XML schema file that defines your service interface methods in terms of SDO data types. All of the entities that were contained in your session bean interface will have a corresponding DataObject element in this schema file. At runtime, these DataObjects are registered with the SDO runtime by calling\nXSDHelper.INSTANCE.define() method. A static type-specific DataObject is defined for each SDO type.\nWhen you deploy the JDeveloper integrated server, database tables are automatically created for every entity that does not have a corresponding existing mapped table. One database table will be generated per unmapped JPA entity.\nNote:Primary key referential integrity constraints will be generated, but other constraints may not be.\nTo generate database tables from JPA entities:\nCreate your JPA entity using the modeling tools or the Create Entity wizards. For more information, see Section used to generate artifacts such as interfaces.\nAn annotation is a metadata modifier that is added to a Java source file. Annotations are compiled into the classes by the Java compiler at compile time, and can be specified on classes, fields, methods, parameters, local variables, constructors, enumerations, and packages. Annotations can be used to specify attributes for generating code, for documenting code, or for providing services like enhanced business-level security or special business logic during runtime.\nEvery type of annotation available for your EJB/JPA classes can also, alternatively, be added to an XML deployment descriptor file. At runtime the XML will override any annotations added at the class level.\nAnnotations are marked with the\n@ symbol, such as this stateless session bean annotation:\n@Stateless public class MySessionBean\nFor more information on annotations for EJB 3.6.8, \"How to Annotate Java Classes.\".\nAnnotations are available to indicate the bean type. Adding your bean type annotation to a regular class turns it into an EJB.\nThe following types of annotations are available:\nIs Stateless Session Bean. Choose TRUE or FALSE to annotate your class as a stateless session bean.\nIs Stateful Session Bean. Choose TRUE or FALSE to annotate your class as a stateful session bean.\nIs Message Driven Bean. Choose TRUE or FALSE to annotate your class as a message driven bean.\nAnnotations support a new Java Persistence API as an alternative to entity beans.\nThe following types of annotations are available:\nIs JPA Entity. Choose TRUE or FALSE to annotate your class as a JPA entity.\nIs JPA Mapped Superclass. Choose TRUE or FALSE to annotate your class as a JPA mapped superclass.\nIs JPA Embeddable. Choose TRUE or FALSE to annotate your class as JPA embeddable.\nOnce you transform your regular Java class into an EJB/JPA component, or if you used one of the EJB/JPA wizards to create the component, the Property Inspector displays a different set of contextual options, which you can use to add or edit annotations for the various members within the component class.\nDuring design time, JDeveloper provides you with the list of available annotations to insert into your classes. The options change depending on what type of class you are working on, and what member you have selected.\nYou can annotate any regular Java class to turn it into an EJB/JPA component. Once the class is defined with annotations as an EJB/JPA, you can easily customize the component with a variety of member-level annotations available to choose from in the JDeveloper, select the class you want to annotate.\nIn the Structure window, double-click the member you want to annotate.\nAs an alternative, if your class is already open in the Java source editor, put your curser in the location where you intend to insert your annotation.\nIn the Property Inspector, choose the tab corresponding to your EJB/JPA type.\nChoose from any of the annotations available for the specific member you have selected.\nWhen you create entities from database tables, foreign keys are interpreted as relationships between entities. You can further define these relationships, create new relationships, or map existing relationships to existing tables using the JDeveloper modeling tools. With the modeling tools you can represent relationships as lines between entities, and change the relationships by changing the line configurations. For more information, see Section 23.3, \"Modeling EJB/JPA Components on a Diagram.\".\nJava Persistence Query Language (JPQL) offers a standard way to define relationships between entity beans and dependent classes by introducing abstract schema types and relationships in the deployment descriptor. JPQL also defines queries for navigation using abstract schema names and relationships.\nThe JPAQL query string consists of two mandatory clauses: SELECT and FROM, and an optional WHERE clause. For example:\nselect d from Departments d where d.department_name = ?1\nThere are two kinds of methods that use JPQL, finder methods and select methods.\nFinder methods are exposed to the client and return either a single instance, or a collection of entity bean instances.\nSelect methods are not exposed to the client, they are used internally to return an instance of\ncmp-field type, or the remote interfaces represented by the\ncmr-field.\nThe Java Persistence API lets you declaratively map Java objects to relational database tables in a standard, portable way that works both inside a Java EE 5 application server and outside an EJB container. This approach greatly simplifies Java persistence and provides an object-relational mapping approach.\nWith Oracle TopLink you can configure the JPA behavior of your entities using metadata annotations in your Java source code. At run-time the code is compiled into the corresponding Java class files.\nTo designate a Java class as a JPA entity, use the\n@Entity annotation, as shown in Example 12-6.\nYou can selectively add annotations to override defaults specified in your deployment descriptors.\nFor more information on JPA Annotations, see the TopLink JPA Annotation Reference at.\nA Java service facade implements a lightweight testing environment you can run without an application server.\nWith EJB 3.0 the Java service facade is similar to an EJB session facade, because you can generate facade methods for entities in the same persistence unit, without the container.\nSeparating workflow with Java service facades eliminates the direct dependency of the client on the participant JPA objects and promotes design flexibility. Although changes to participants may require changes in the Java service facade, centralizing the workflow in the facade makes such changes more manageable. You change only the Java service facade rather than having to change all the clients. Client code is also simpler because it now delegates the workflow responsibility to the session facade. The client no longer manages the complex workflow interactions between business objects, nor is the client aware of interdependencies between business objects.\nYou may choose to make the Java service class runnable by generating a sample Java client with a main() method.\nUse the JDeveloper Java service facade wizard to create a Java class as a service facade to entities. To create a new Java service facade select the File menu, then New, then Business Tier, then EJB, then Java Service Facade.\nYou can also create a data control from a service facade. In the Application Navigator, right-click the name of the service facade, then select Create Data Control. From the Bean Data Control Interface Chooser dialog, you can choose to implement\noracle.binding.* data control interfaces. The interfaces are\nTransactionalDataControl,\nUpdatableDataControl, and\nManagedDataControl. For more information, select the Help button in the dialog.\nA session bean represents a single client inside the application server. To access an application deployed on the server, the client invokes the session bean methods. The session bean performs work for its client, shielding the client from complexity by executing business tasks inside the server. A session bean is similar to an interactive session. A session bean is not shared and has only one client, in the same way that an interactive session can have only one user. Like an interactive session, a session bean is not persistent as it does not save data to the database. When the client terminates, its session bean appears to terminate and is no longer associated with the client.\nCreate your session beans and session bean facades using the JDeveloper Session Bean Wizard. For more information, see Section 12.7.2, \"How to Create a Session Bean.\".\nThere are two types of session beans:\nStateful..\nWith JDeveloper you can select to automatically generate your session facade methods any time you create a session bean through the session bean wizard. This creates a session bean that functions as a session facade for your business workflow. For more information, see Section 12.7.2, \"How to Create a Session Bean.\".\nThe session facade is implemented as a session bean. The session bean facade encapsulates the complexity of interactions between the business objects participating in a workflow by providing a single interface for the business services of your application.The session facade manages the relationships between numerous BusinessObjects and provides a higher level abstraction to the client.\nSession facades can be either stateful or stateless, which you define while creating a session facade in the wizard.\nFor more information on session facades, see the Oracle Technology Network at\nUse the wizard to automatically implement a session facade when you create a session bean, and to choose the methods you want to implement. Once you've created EJB entities, any session beans you create in the same project are aware of the entities and the methods they expose.\nUse the session bean wizard to create a new session bean or session facade bean. Or you can create a session bean using the modeling tools.\nTo create a session bean or session facade using a wizard: a method so it will not be exposed.\nFor more information on session facades, see the Core J2EE Pattern Catalog at.\nYou can also create a session facade manually by creating a local reference between a session bean and an entity.\nTo create a local reference:\nCreate a session bean, if you have not already done so.\nCreate a local reference between the beans:\nIn the bean class - If you are using EJB 3, select an EJB.\nIn the Structure pane, right-click the EJB, then choose Enterprise Java Beans (EJB), then choose Properties.\nIn the Bean Method Details dialog, edit details, as necessary.\nWhen finished, click OK.\nYou can add fields to EJBs on an EJB diagram or through the EJB Module Editor., select an EJB.\nIn the Structure pane, right-click the EJB, then choose Enterprise Java Beans (EJB) node, then choose New Field.\nIn the Field Details dialog, add details, as necessary.\nWhen finished, click OK.\nYou can remove fields from EJBs, as described below.\nTo remove a field on an EJB Diagram:\nClick in the fields compartment (the first compartment) on an EJB.\nHighlight the field and press the Delete key.\nTo remove a field using the, select an EJB.\nIn the Structure pane, double-click the field to locate it in the source file.\nIn the source file, delete the field.\nEnvironment entries are name-value pairs that allow you to customize the bean's business logic. Since environment entries are stored in an enterprise bean's deployment descriptor, a bean's business logic can be changed without changing its source code.\nFor example, an EJB that calculates an order might give a discount depending on the number of items ordered, a certain status (silver, gold, platinum), or for a promotion. Before deploying the bean's application you could assign the discount a certain percentage. When the application runs, a method would call the environment entry to find out the discount value. If you wanted to change that percentage in a different deployment, you would not need to change the source code, you would just need to change the value in the environment entries for the deployment descriptor.\nEnvironment entries are annotated in the source code.\nFor the complete EJB 3.0 Java Community Process specifications and documentation, see.\nDepending on how your develop your application, there are different methods of exposing data to clients.\nIf you're using the Oracle ADF framework, the preferred method of exposing data to clients is to implement the session facade design pattern and drop the session bean onto the data control palette. This option vastly simplifies data coordination and is only available in the JDeveloper Studio release. For more information, see Section.2, \"Developing Applications with JavaServer Faces.\"\nA resource reference is an element in a deployment descriptor that identifies the component's coded name for the resource. Resource references are used to obtain connector and database connections, and to access JMS connection factories, JavaMail sessions, and URL links.\nTo add or modify EJB 3.0 resource references:\nGo to your source code to annotate resource references.\nA primary key is a unique identifier with one or more persistent attributes. It identifies one instance of a class from all other instances of the same type. Use primary keys to define relationships and to define queries.\nEach JPA entity instance must have a primary key. To accommodate your database schema, you can define simple primary keys from persistent fields or composite primary keys from multiple persistent fields. You can also define automatic primary key value generation to simplify your JPA entity implementation.\nThe simplest way to specify a simple primary key is to use annotations for a single primitive, or JDK object type entity field as the primary key. You can also specify a simple primary key at deployment time using deployment XML.\nTo configure a simple primary key using annotations:\nIn your JPA entity implementation, annotate the primary key field using the\n@Id annotation, as shown in Example 12-7.\nExample 12-7 Configuring Primary Key Using Annotations\nimport javax.ejb.Entity; import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Column; @Entity @Table(name = \"EMP\") public class Employee implements java.io.Serializable { private int empNo; private String eName; private String birthday; private Address address; private int version; public Employee() { { @Id @Column(name=\"EMPNO\") public int getEmpNo() { return empNo; } ... }\nPackage and deploy your application.\nTo configure a simple primary key using deployment XML:\nIn your JPA entity implementation, implement a primary key field, as shown in Example 12-8.\nFor certain ADF Faces features, a designated primary key is required. For example, if you have an ADF Faces table that uses an\naf:tableSelectMany component, you will need to specify a primary key to be able to implement sorting. When you create EJB/JPA entities from tables (using EJB 3, find the attribute you want as the primary key and set the PrimaryKey value to true.\nJDeveloper automatically provides a complete set of data control components when you build an ADF Fusion web application. When you build a Java EE application, and/or an EJB project, you assign ADF data controls on your individual session beans. This adds a data control file with the same name as the bean.\nFor.\".\nAn EJB module is a software unit comprising one or more EJBs, a persistence unit, and an optional EJB deployment descriptor. A JDeveloper project contains only one EJB module. At deploy-time, the module is packaged as an\nejb.jar file.\nEntity beans were once packaged in the EJB JAR file along with the session and message-driven beans. Today, with JPA entities and the persistence unit technology, at deploy-time, they are packaged in their own JAR file,\npersistenceunit.jar.\nNow your entity beans (JPA entities) are contained separately, in a JPA persistence archive JAR, which includes a\npersistence.xml file. The JPA persistence unit does not have to be part of the EJB module package, but can be bundled inside the\nejb.jar file.\nJDeveloper project can contain only one EJB module. When you create your first session or message-driven bean in a project, a module is automatically established, if one does not already exist. You are given the option of choosing the EJB version and the persistence manager for your new EJB module.\nWhen you deploy your project you convert the aggregate of session and message-driven beans, plus deployment descriptor into an a EJB JAR file (.jar file), ready for deployment to an application server or as an archive file. By confining the persistence unit to its own JAR file, the persistence unit can easily be reused in other applications. For more information, see Section 9.1, \"About Deploying Applications.\"\nA JPA persistence unit is comprised of a\npersistence.xml file, one or more optional\norm.xml files, and the managed entity classes that belong to the persistence unit. A persistence unit is a logical grouping of the entity manager, data source, persistent managed classes, and mapping metadata. A persistence unit defines an entity manager's configuration by logically grouping details like entity manager provider, configuration properties, and persistent managed classes.\nEach persistence unit must have a name. Only one persistence unit of a given name may exist in a given EJB-JAR, WAR, EAR, or application client JAR. You can package a persistence unit in its own persistence archive and include that archive in whatever Java EE modules require access to it.\nThe\npersistence.xml file contains sections or groupings, these groupings correspond to your entities, and run-time data related to the entities. When you create a new entity using the entity wizards, and if you have an existing persistence unit in the project, the entity will be inserted into its own section in the persistence.xml. If you do not have an existing persistence unit, one will be created automatically, with a section included for the entity definitions.\nThe JAR file or directory, whose META-INF directory contains the persistence.xml file, is called the root of the persistence unit. An EJB 3 and press Delete.\nYou can import existing EJBs from a JAR file or from a deployment descriptor.\nTo import an EJB module, or a subset of EJBs within an EJB module into a project:\nFrom the File menu, choose Import.\nIn the Import dialog, choose EJB JAR (.jar) File.\nFollow the steps in the wizard.\nTo import an EJB deployment descriptor (ejb-jar.xml) file:\nFrom the File menu, choose Import.\nIn the Import dialog, choose EJB Deployment Descriptor (ejb-jar.xml) File.\nFollow the steps in the wizard\nNote:If you import a deployment descriptor using this wizard, and then use the wizard to import more files, the wizard caches the last used descriptor file, JAR file, and descriptor source directory in the IDE preferences file for convenience. This makes it easier to do tasks such as splitting an EJB module into multiple modules, importing multiple JAR files residing in the same directory, etc.\nTo import a WebLogic deployment descriptor (weblogic.\nTo avoid conflicts, if an EJB with the same name already exists in your existing module, that EJB will not be imported.; the sample client utility can be used to create a client for either type. client and choose Run.\nThe Message pane shows you the running output.\nJDeveloper provides support for JUnit regression testing for your EJBs. JUnit is an open source Java regression testing framework that comes as an optional feature in JDeveloper. To use this feature you'll need to install the JUnit extension.\nUse JUnit to write and run tests that verify your code. After you install the JUnit extension, you can use the simple wizard to select your session bean or Java class files, to select the methods that you want to test within those files, and then to start the JUnit test.\nTo run a JUnit test on an EJB:\nInstall the Junit extension from the JDeveloper Help menu. For more information, see Section,."},"url":{"kind":"string","value":"http://docs.oracle.com/cd/E16162_01/user.1112/e17455/dev_ejb_jpa.htm"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":240,"cells":{"text":{"kind":"string","value":"Dynamically set WCF Endpoint in Silverlight\nWhen you add a WCF service reference to a Silverlight Application, it generates the ServiceReference.ClientConfig file where the URL of the WCF endpoint is defined. When you add the WCF service reference on a development computer, the endpoint URL is on localhost. But when you deploy the Silverlight client and the WCF service on a production server, the endpoint URL no longer is on localhost instead on some domain. As a result, the Silverlight application fails to call the WCF services. You have to manually change the endpoint URL on the Silverlight config file to match the production URL before deploying live. Now if you are deploying the Silverlight application and the server side WCF service as a distributable application where customer install the service themselves on their own domain then you don’t know what will be the production URL. As a result, you can’t rely on the ServiceReference.ClientConfig. You have to dynamically find out on which domain the Silverlight application is running and what will be the endpoint URL of the WCF service. Here I will show you an approach to dynamically decide the endpoint URL.\nFirst you add a typical service reference and generate a ServiceReference.ClientConfig that looks like this:\n\nAs you see, all the URL are pointing to localhost, on my development environment. The Silverlight application now need to dynamically decide what URL the Silverlight app is running from and then resolve the endpoint URL dynamically.\nI do this by creating a helper class that checks the URL of the Silverlight application and then decides what’s going to be the URL of the endpoint.\npublic class DynamicEndpointHelper { // Put the development server site URL including the trailing slash // This should be same as what's set in the Dropthings web project's // properties as the URL of the site in development server private const string BaseUrl = \"\"; public static string ResolveEndpointUrl(string endpointUrl, string xapPath) { string baseUrl = xapPath.Substring(0, xapPath.IndexOf(\"ClientBin\")); string relativeEndpointUrl = endpointUrl.Substring(BaseUrl.Length); string dynamicEndpointUrl = baseUrl + relativeEndpointUrl; return dynamicEndpointUrl; } }\nIn the Silverlight app, I construct the Service Client this way:\nprivate DropthingsProxy.ProxyServiceClient GetProxyService() { DropthingsProxy.ProxyServiceClient service = new DropthingsProxy.ProxyServiceClient(); service.Endpoint.Address = new EndpointAddress( DynamicEndpointHelper.ResolveEndpointUrl(service.Endpoint.Address.Uri.ToString(), App.Current.Host.Source.ToString())); return service; }\nAfter creating the service client with default setting, it changes the endpoint URL to the currently running website’s URL. This solution works when the WCF services are exposed from the same web application. If you have the WCF services hosted on a different domain and you are making cross domain calls to the WCF service then this will not work. In that case, you will have to find out what’s the domain of the WCF service and then use that instead of localhost."},"url":{"kind":"string","value":"http://weblogs.asp.net/omarzabir/dynamically-set-wcf-endpoint-in-silverlight"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":241,"cells":{"text":{"kind":"string","value":"Many in polynomial time, which means there’s a way to cheat.\nThat being said, OptaPlanner solves the\n1 000 000 queens problem in less than 3 seconds. Here’s a log to prove it (with time spent in milliseconds):\nINFO Opened: data/nqueens/unsolved/10000queens.xml INFO Solving ended: time spent (23), best score (0), ... INFO Opened: data/nqueens/unsolved/100000queens.xml INFO Solving ended: time spent (159), best score (0), ... INFO Opened: data/nqueens/unsolved/1000000queens.xml INFO Solving ended: time spent (2981), best score (0), ...\nHow to cheat on the N Queens problem\nThe N Queens problem is not NP-complete, nor NP-hard. That is math speak for stating that there’s a perfect algorithm to solve this problem: the Explicits Solutions algorithm. Implemented with a CustomSolverPhaseCommand in OptaPlanner it looks like this:\npublic class CheatingNQueensPhaseCommand implements CustomSolverPhaseCommand { public void changeWorkingSolution(ScoreDirector scoreDirector) { NQueens nQueens = (NQueens) scoreDirector.getWorkingSolution(); int n = nQueens.getN(); List queenList = nQueens.getQueenList(); List rowList = nQueens.getRowList(); if (n % 2 == 1) { Queen a = queenList.get(n - 1); scoreDirector.beforeVariableChanged(a, \"row\"); a.setRow(rowList.get(n - 1)); scoreDirector.afterVariableChanged(a, \"row\"); n--; } int halfN = n / 2; if (n % 6 != 2) { for (int i = 0; i < halfN; i++) { Queen a = queenList.get(i); scoreDirector.beforeVariableChanged(a, \"row\"); a.setRow(rowList.get((2 * i) + 1)); scoreDirector.afterVariableChanged(a, \"row\"); Queen b = queenList.get(halfN + i); scoreDirector.beforeVariableChanged(b, \"row\"); b.setRow(rowList.get(2 * i)); scoreDirector.afterVariableChanged(b, \"row\"); } } else { for (int i = 0; i < halfN; i++) { Queen a = queenList.get(i); scoreDirector.beforeVariableChanged(a, \"row\"); a.setRow(rowList.get((halfN + (2 * i) - 1) % n)); scoreDirector.afterVariableChanged(a, \"row\"); Queen b = queenList.get(n - i - 1); scoreDirector.beforeVariableChanged(b, \"row\"); b.setRow(rowList.get(n - 1 - ((halfN + (2 * i) - 1) % n))); scoreDirector.afterVariableChanged(b, \"row\"); } } } }\nNow, one could argue that this implementation doesn’t use any of OptaPlanner’s algorithms (such as the Construction Heuristics or Local Search). But it’s straightforward to mimic this approach in a Construction Heuristic (or even a Local Search). So, in a benchmark, any Solver which simulates that approach the most, is guaranteed to win when scaling out.\nWhy doesn’t that work for other planning problems?\nThis algorithm is perfect for N Queens, so why don’t we use a perfect algorithm on other planning problems? Well, simply because there are none!\nMost planning problems, such as vehicle routing, employee rostering, cloud optimization, bin packing, … are proven to be NP-complete (or NP-hard). This means that these problems are in essence the same: a perfect algorithm for one, would work for all of them. But no human has ever found such an algorithm (and most experts believe no such algorithm exists).\nNote: There are a few notable exceptions of planning problems that are not NP-complete, nor NP-hard. For example, finding the shortest distance between 2 points can be solved in polynomial time with A*-Search. But their scope is narrow: finding the shortest distance to visit n points (TSP), on the other hand, is not solvable in polynomial time.\nBecause N Queens differs intrinsically from real planning problems, is a terrible use case to benchmark.\nConclusion\nBenchmarks on the N Queens problem are meaningless. Instead, benchmark implementations of a realistic competition.\nOptaPlanner‘s examples implement several cases of realistic competitions."},"url":{"kind":"string","value":"http://www.javacodegeeks.com/2014/05/cheating-on-the-n-queens-benchmark.html"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":242,"cells":{"text":{"kind":"string","value":"#include \nFlags controlling the details of output in deal.II intermediate format. At present no flags are implemented.\nDefinition at line 989 of file data_out_base.h.\nAn indicator of the current file format version used to write intermediate format. We do not attempt to be backward compatible, so this number is used only to verify that the format we are writing is what the current readers and writers understand.\nDefinition at line 997 of file data_out_base.h."},"url":{"kind":"string","value":"http://www.dealii.org/developer/doxygen/deal.II/structDataOutBase_1_1Deal__II__IntermediateFlags.html"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":243,"cells":{"text":{"kind":"string","value":"You can subscribe to this list here.\nShowing\n2\nresults of 2\nGreetings-\nI am trying to find out if Mailman can be installed on a 1&1 Business level Shared Linux hosting package.\nI have discovered such things as this:\nWhich makes it sound like since 1&1 has separated servers into Web / Mail / Database that it is not possible to install Mailman. That makes Mailman sound like it is intended for servers smaller than a\n$10 per month plan... or dedicated which is out of the budget.\nWe have shell access.\nWe can set up cron jobs.\nI know the hostname to an internal SMTP that does not require authentication to connect to it. (Useful for things like setting up an email list server.)\nI guess I am a bit bewildered by such posts (like the above URL) as I have managed to dig up. Along with...\nSteps in the installation that speak of a requirement to add a user and a group:\nChanging group ownership of the directory:\nCan I not just skip those steps since this is a shared hosting environment?\nPlease advise.\n--\nMichael Lueck\nLueck Data Systems\nHi!\nI've just set up a MailManager (MailManager-2.1.tar.gz and =\n3rdParty-2.1-rc7.tar.gz), with zope2.10 from Debian testing (Lenny). =\nThere are several errors of this type popping up:\n2007-11-09T16:53:24 ERROR Application Could not import =\nProducts.MailManager Traceback (most recent call last):\nFile \"/usr/lib/zope2.10/lib/python/OFS/Application.py\", line 708, in =\nimport_product\nproduct=3D__import__(pname, global_dict, global_dict, silly)\nFile \"/home/john/myzope/Products/MailManager/__init__.py\", line 10, in =\n?\nimport MailManager, MMUserFolder\nFile \"/home/john/myzope/Products/MailManager/MailManager.py\", line 92, =\nin ?\nfrom Products.MailManager.Reporting import ReportingDataMixin, =\nmanage_addQueueReportingEngine\nFile \"/home/john/myzope/Products/MailManager/Reporting.py\", line 60, =\nin ?\nglobals())\nFile =\n\"/usr/lib/zope2.10/lib/python/Products/PageTemplates/PageTemplateFile.py\"=\n, line 89, in __init__\ncontent =3D open(filename).read()\nIOError: [Errno 2] No such file or directory: =\n'/home/john/myzope/Products/MailManager/www/manage_addQueueReportingEngin=\neForm.zpt'\n(/home/john/testzope is where I put my Zope instance)\nIt tries to load a few non-existant page template files, these are:\nReporting.py, line 60, referring to =\nwww/manage_addQueueReportingEngineForm.zpt\nMailManager.py:4348, www/master_fullwidth.zpt\nMailManager.py:4383, www/Test.zpt\nruleset/zope.py:83, ruleset/www/manage_addRulesetEngineForm.zpt\nI'm guessing Test.zpt is the same as test.zpt, but the others are =\ncompletely missing. The last one even seems to be pointing at the wrong =\ndirectory (whould probably be under www, not ruleset/www). I've created =\ndummy files with those names, and MailManager happily runs so far but it =\nwill probably bug out as soon as I hit those pages. I cannot find those =\nfiles anywhere, including SVN (tested with the complete SVN sources, =\nwith the same issue). Where are they, or if they don't exist, what =\nshould be done with the references to them?\nRegards,\nJohn St=E4ck"},"url":{"kind":"string","value":"http://sourceforge.net/p/mailmanager/mailman/mailmanager-users/?viewmonth=200711"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":244,"cells":{"text":{"kind":"string","value":"CS CODEDOM Parser is utility which parses the C# source code and creates the CODEDOM tree of the code (general classes that represent code, part of .NET Framework - namespace System.CodeDom) .\nCurrent version (0.1) is limited - it parses code down to type members and their parameters, it has very limited support for expressions and it does not parse the statements inside members. There are two main reasons for why I stayed at this level now\nOn the other hand it also parses source code comments, so it can be used to analyze the interdependencies of code and comments.\nAlso the stability of this version is low - it's kind of alpha version. If anybody wants to help get this thing further he is welcomed.\nThe parser is based on Mono - CSharp Compiler code. I was looking around little bit around for available C# parser and C# parser building tools (I wanted C# parser in C#) and finally decided for Mono. For more details about exploitation of Mono parser and other possibilities I explored see section C# parser Tools.\nAt first I thought it is great idea to use language independent syntax tree and CodeDom looks nice. If some code analysis tool is build on it, it can work for any .NET language. Just need to change parser and rest is the same, sounds cool. But, after I've got into the CodeDom, I have found that a lot of language features (and not just C#, basically for any language) is missing and it is not possible to parse the source code fully. The main problem is in expressions and statements, where CodeDom has very limited set of classes - there is for instance no support for unary operation and more more issues.\nI decided to continue with CodeDom, even with its limitations, because it was enough for purposes of analyzing code for coding standards (at least what I need now - it also enables to keep comments and code in one tree, which is something I liked), but it is open issue for the future development.\nHere is list of issues I've found (and there is more,): own syntax tree, but I still like the idea of the independent language tree structure, which can be used in different tasks).\nReporting of errors and warnings should be improved (unify codes and messages, unify error reporting, Report class should store reported errors).\nAlso parser should be improved to indicate location of syntax elements more exactly in the source file.\nBetter separation between the parser and CODEDOM builder is also needed.\nIf somebody likes the tool and wants to help with its improvements, he is welcome.\nThis article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.\nA list of licenses authors might use can be found here\nleppie\nnull\npublic class CSharpCodeProvider : CodeDomProvider\n{\npublic CSharpCodeProvider();\npublic override ICodeCompiler CreateCompiler();\npublic override ICodeGenerator CreateGenerator();\npublic override TypeConverter GetConverter(Type type);\npublic override string FileExtension { get; }\n}\npublic abstract class CodeDomProvider : Component\n{\nprotected CodeDomProvider();\npublic abstract ICodeCompiler CreateCompiler();\npublic abstract ICodeGenerator CreateGenerator();\npublic virtual ICodeGenerator CreateGenerator(string fileName);\npublic virtual ICodeGenerator CreateGenerator(TextWriter output);\npublic virtual ICodeParser CreateParser();\npublic virtual TypeConverter GetConverter(Type type);\npublic virtual string FileExtension { get; }\npublic virtual LanguageOptions LanguageOptions { get; }\n}\n//From the SS CLI\npublic virtual ICodeParser CreateParser() {\nreturn null;\n}\n//From Anakrino\npublic virtual ICodeParser CreateParser() {\nreturn null;\n}\n//and finally the IL\nCodeDomProvider.CreateParser\n.maxstack 8\nL_0000: ldnull\nL_0001: ret\nGeneral News Suggestion Question Bug Answer Joke Praise Rant Admin\nUse Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages."},"url":{"kind":"string","value":"http://www.codeproject.com/Articles/2502/C-CodeDOM-parser?fid=4186&df=90&mpp=10&noise=1&prof=True&sort=Position&view=Expanded&spc=None&select=734743&fr=1"},"dump":{"kind":"string","value":"CC-MAIN-2016-07"},"lang":{"kind":"string","value":"en"},"source":{"kind":"string","value":"refinedweb"}}},{"rowIdx":245,"cells":{"text":{"kind":"string","value":"Friend.)\nHere is the canonical “Hello, world” example app:\nimport tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write(\"Hello, world\") application = tornado.web.Application([ (r\"/\", MainHandler), ]) if __name__ == \"__main__\": application.listen(8888) tornado.ioloop.IOLoop.instance().start()\nWe attempted to clean up the code base to reduce interdependencies between modules, so you should (theoretically) be able to use any of the modules independently in your project without using the whole package.\nA Tornado web application maps URLs or URL patterns to subclasses of tornado.web.RequestHandler. Those classes define get() or post() methods to handle HTTP GET or POST requests to that URL.\nThis code maps the root URL / to MainHandler and the URL pattern /story/([0-9]+) to StoryHandler. Regular expression groups are passed as arguments to the RequestHandler methods:\nclass MainHandler(tornado.web.RequestHandler): def get(self): self.write(\"You requested the main page\") class StoryHandler(tornado.web.RequestHandler): def get(self, story_id): self.write(\"You requested the story \" + story_id) application = tornado.web.Application([ (r\"/\", MainHandler), (r\"/story/([0-9]+)\", StoryHandler), ])\nYou can get query string arguments and parse POST bodies with the get_argument() method:\nclass MainHandler(tornado.web.RequestHandler): def get(self): self.write('