Coarse Grained BMP beans with Dependent Value Objects

YOLO26算法城市道路车辆与行人目标检测+训练好的模型+261张数据集+pyqt可视化界面.zip 附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[路障(barrier), 自行车(bicycle), 公交车(bus), 小汽车(car), 施工车辆(construction_vehicle), 摩托车(motorcycle), 行人(pedestrian), 交通锥(traffic_cone), 拖车(trailer), 卡车(truck)] · 总计:261 张 · 测试集:44 张 · 验证集:146 张 · 训练集:71 张 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 92 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.1446** mAP50-95 | 0.0706 Precision | 0.4273 Recall | 0.1741 train/box_loss | 2.0121 train/cls_loss | 2.1335 val/box_loss | 2.1985 val/cls_loss | 2.2913 【训练过程分析】 这轮训练从一开始就没有给我太多惊喜。训练曲线显示,train/box_loss 和 train/cls_loss 都在前 40 轮快速下降,这让我一度觉得模型很快就能收敛,然而后续的曲线却让我感到有些无奈。从第 41 轮开始,train/box_loss 只是在缓慢下降,而 train/cls_loss 则一直保持在一个较高的水平,这表明模型在... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。 立即下载
Coarse Grained BMP beans with Dependent Value Objects
is a draft pattern from the upcoming sequel of Mastering Enterprise Java Beans. The pattern describes how to properly implement the equivalent of Dependent Objects in BMP, and provides a fully resuable implementation as an example. The pattern does not describe the motivation for dependent objects, that is a separate pattern and you can learn more about it by reading the EJB 2.0 specs or Sun's ejb-interest archives.
Coarse Grained BMP beans with Dependent Value Objects
By Floyd Marinescu, Senior Architect, The Middleware Company.
Please email comments/suggestions to: floyd@middleware-company.com.

Performance and efficiency concerns require a standard way to build coarse-grained entity beans using BMP as well as CMP.

Dependent objects provide an automatic way to build coarse-grained entity beans for CMP entity beans, but the EJB 2.0 specification doesn’t provide an equivalent mechanism for BMP entity beans.

* * *

Building your entity beans to be coarse-grained is a common performance optimization. It allows modeling the business objects with plain java classes rather than as entity beans, reducing the inter-remote object communication and transactional overhead associated with entity beans.  These plain classes typically have a life cycle dependent on a parent entity bean, do not have a distinct identity of their own and do not need to be referenced remotely by a client. For CMP, these objects are called dependent objects, and EJB 2.0 defines a standard way to define CMP dependent objects, leaving the complex task of persisting them to the underlying application server.

Unfortunately, BMP entity bean developers cannot leverage dependent objects, they are a CMP construct only. However, BMP developers should still be able to create coarse-grained entity beans,

Therefore:

BMP developers should model dependent business data in plain java classes called Dependent Value Objects.  Dependent Value Objects are stored inside your entity beans and are created, modified and removed by your entity beans. Unlike dependent objects with CMP, BMP developers must explicitly write the persistence code of dependent value objects.

Dependent Value Objects are similar to Value Objects in that they are plain java classes and are transportable over the network (this is one advantage over CMP dependent objects, which cannot be accessed by clients). Unlike Value Objects, Dependent Value Objects are persistent objects whose life cycle is managed by an entity bean, whereas Value Objects only exist to transport data across the network in bulk, and are typically discarded once data has been read.

An entity bean can store dependent value objects in a one to one, or one to many fashion.  For example, consider a Resume. A Resume entity bean would only require one Address dependent value object, whereas it would require multiple Job Entry objects, which could be stored in a Collection inside the Resume entity bean, as in figure 1.


Figure 1: ResumeBean class diagram with Address and Job Entry Dependents

Implementing dependent value objects with BMP is not trivial. A good implementation will feature:

  • Dependent value objects that map to tables in a database
  • Immutable dependent value objects
  • Lazy loading of dependent value objects
  • Intelligent lifecycle management  (caching updates until ejbStore, only storing new or modified dependent value objects, etc)
  • Partitioning of persistence logic from business logic

One of the easiest ways to persist dependent value objects is to simply serialize them to a SQL BLOB column in the table which your entity bean maps to. If dealing with a collection of dependent value objects, the whole collection could be serialized into this column. A better alternative is to persist your dependent value objects to separate tables, using JDBC to map your objects in an attribute-per-column manner. Persisting your dependent value objects in this manner will allow them to be accessible to sql searches and allow you to perform reporting and maintenance directly on the database (you can’t do this if they are stored as blobs). From our Resume example, our Resume entity bean maps to a resumes table in the database, whereas our Address dependent value object maps to an addresses table and our Job Entries map to a  jobentries table, as in figure 2. Since our addresses and job entries are dependent value objects, they do not have their own identity outside of their parent Resume entity bean, and thus they do not have their own primary key, instead they are identified by a resumeID column in the addresses and job entries table.


Figure 2: EJB and dependent object DB mapping

Dependent Value Object should be made immutable, that is, they should have no set methods.  In CMP, dependent objects cannot be passed to a client, they can only be accessed internally by an entity bean. One advantage to this restriction is that it ensures that any updating of data in an entity bean is done through the entity bean’s own business methods (encapsulation).  In BMP, we are not faced with this restriction since dependent value objects are just regular java classes. In order to achieve the same benefit in BMP but still have the flexibility of passing our dependent value objects to clients, dependent value objects should be made immutable. This will ensure that the client doesn’t make changes to the value object assuming that his changes will be instantly reflected on the server, thus forcing the client to perform all changes through the entity beans remote interface.

Lazy Loading is a performance enhancement that allows dependent value objects to be loaded on demand. It avoids the wasteful practice of loading up all of an entity beans dependent value objects inside ejbCreate(), particularly if a client isn’t interested in the dependent data.

Lazy Loading is easy to implement. Each of your dependent value objects or collections can have get methods which:

  • Check to see if the internal dependent value object or collection is has been loaded (is null).
  • Calls the database and loads up the requested dependent data if not previously loaded
  • Passes the requested dependent value object (or collection) to the caller.

Once the dependent value object (or collection) has been read from the database, it can be cached inside the entity bean for future calls, as in our getAddress() and getJobs() in our Resume Bean (see downloadable example source at bottom of pattern).

In a BMP scenario, intelligent life cycle management is the programmers responsibility. Unfortunately, this is not trivial, particularly when dealing with a collection of dependent objects. A lot of life cycle management and database synchronization logic must be written to track dependent value objects as they are created, updated, and deleted.  A good BMP implementation will only update the database with dependent objects that have been modified, created or deleted.  It will also allow multiple operations (update, delete, etc) on dependent objects within one transaction and only synchronize the final state of an entity bean’s dependent objects with the database at transaction completion (in ejbStore).

Partitioning of persistence logic from business logic. Given the complexities of life cycle management of dependent value objects, many BMP developers choose to mix their persistence logic with their business logic by adding primary keys or dirty flags to dependent value objects, even interlacing their business logic with code necessary to track the life cycle of dependent value objects. To make programming with dependent value objects in BMP as easy as it in CMP, a developer should not add any special fields to his dependent value objects, nor should persistence logic be mixed in with business logic.

So how can a BMP developer achieve intelligent dependent value object lifecycle management and keep persistence logic separate from business logic? The answer is to abstract these details into a special collection class designed to track the lifecycle of dependent value objects that it is storing.  Figure 3 illustrates a DependentValueSet, a special implementation of the Java 2 Set Collection. Along with supporting the normal operations of a Set (including add, remove, etc), the collection adds several new methods including an update(oldObject, newObject) method that takes two dependent value objects as a parameters, the original object and the newly updated one.  Since dependent value objects (like CMP dependent objects) do not have any identity of their own (no primary key), we require that the original object be passed as a parameter so that our Set will know which object to replace.


Figure 3: The DependentValueSet Class

Using the DependentValueSet allows CMP developers to achieve separation of persistence logic from business logic because business methods need only interact with the normal operations of the Set interface and the extra update method. Dependent Value Objects are also kept clean; they do not need any special attributes added to track their state, as the DependentValueSet handles all of that transparently.

Our DependentValueSet implementation allows for intelligent lifecycle management by tracking which of our dependent objects were created, deleted or modified internally. This is extremely powerful as it allows the user to perform multiple operations on dependent value objects within one transaction, and synchronize the final state of our dependent value objects just once in ejbStore(). For example, the same dependent value object can be updated multiple times, but in ejbStore(), only one database update needs to be performed.

To support database synchronization, our DependentValueSet adds 5 extra methods:

  • addObjectFromDatabase(Object)
  • getObjectsToInsert()
  • getObjectsToDelete()
  • getObjectsToUpdate()
  • databaseHasBeenUpdated()

The addObjectFromDatabase method is meant to be called when dependent value objects are initially loaded from the database. It allows the DependentValueSet to track the objects that were initially in the database. The getObjectToXXX methods allow a BMP developer to query the DependentValueSet to find out which objects should be inserted, deleted, or updated, and write the dependent value object specific SQL code to handle these updates in ejbStore(). Once synchronization is complete, the DependentValueSet should be notified (databaseHasBeenUpdated ) so that it can clear itself up for the next transaction.

From our Resume example, we store our collection of job entries in a DependentValueSet. The entity beans remote interface exposes create, read, update, and remove (CRUD) operations for job entries, each of which delegate to methods on the DependentValueSet called jobentries, which handles all the life cycle tracking of the resumes jobs. At the end of the transaction (in ejbStore() ), we query our DependentValueSet to determine which job entries have been created, removed, or updated, and execute the appropriate SQL accordingly.

Each Resume only requires one Address dependent value object, thus we don’t need the advanced services of our DependetValueSet. Instead, we can manually get and set the object, and simply keep around an isAddresssModifed flag so that ejbStore() will know if our Address has been set in this transaction, and store it in the database if so.

Download the example source code including the full DependentValueSet.java implementation.

基于统一环境建模与可行性约束一致化的三维路径规划A星RRT星与粒子群优化对比研究(Matlab代码实现) 内容概要:本文系统研究了基于统一环境建模与可行性约束一致化的三维路径规划问题,对A*算法、RRT*算法与粒子群优化(PSO)算法在三维空间中的路径规划性能进行了深入对比分析。通过构建标准化的仿真环境与统一的可行性约束条件,从路径长度、规划耗时、避障能力及路径平滑性等多个维度对三种算法进行定量评估,全面揭示其各自的优势与局限性。研究旨在为不同应用场景下的路径规划算法选型提供科学依据与技术指导,并配套提供了完整的Matlab代码实现,便于读者复现结果与进一步研究。; 适合人群:具备一定算法基础和Matlab编程能力,从事机器人、自动驾驶、无人机或智能系统等相关领域研究的研发人员及研究生。; 使用场景及目标:① 掌握A*、RRT*、PSO等主流路径规划算法的核心思想与实现细节;② 学习如何在统一标准下对不同算法进行公平、有效的性能对比与评估;③ 获取可直接用于科研或项目开发的三维路径规划Matlab代码框架。; 阅读建议:建议读者在阅读过程中结合提供的Matlab代码进行实践操作,通过修改环境参数和算法配置来观察不同算法的表现差异,从而加深对算法原理与适用场景的理解。 立即下载

相关推荐

Vivado IP核与License许可全解析:从免费到收费,从评估到部署

本文全面解析Vivado IP核与License许可机制,从免费到收费IP核的选型指南到License的申请与部署策略。详细介绍了Xilinx官方IP核的优势与局限,第三方IP核的风险与应对,以及实战中的资源优化技巧和版本兼容性问题,帮助开发者高效利用Vivado工具链。

weixin_29169505的博客 370

Coarse Grained BMP beans with Dependent Value Objects (转)

Coarse Grained BMP beans with Dependent Value Objects (转)[@more@]Coarse Grained BMP beans with Dependent Value obj...

csd3176的博客 79

新手别怕!用嘉立创EDA从零画一块ESP8266最小系统板(附完整PCB源文件)

本文详细指导新手如何使用嘉立创EDA从零开始设计ESP8266最小系统板,涵盖原理图绘制、PCB布局、布线技巧及设计验证等关键步骤。通过实战案例和实用技巧,帮助读者快速掌握PCB设计基础,轻松打造自己的物联网开发板,并附完整PCB源文件供参考。

weixin_28716769的博客 630

同花顺API+Python+Excel:金融数据自动化报表完整实战

金融数据分析与量化投研中,传统手工复制行情数据到Excel的方式效率低且易出错,数据清洗与报表自动化成为刚需。通过Python调用同花顺开放平台API,可获取结构化行情数据,再结合pandas进行类型转换、缺失值处理和复权计算,最后利用openpyxl写入Excel并完成样式美化,即可实现从取数到成表的全流程自动化。该方案不仅覆盖股票、期货等常见金融数据场景,还支持定时任务与批量处理,显著提升日报、周报产出效率。从数据获取习惯到报表设计细节,本文提供一套可落地的工程实践路径,适用于金融从业者、量化爱好者及需

cuiji1279的博客 361

ITIL 4 Foundation 自学通关笔记1

ITIL 4 Foundation 自学通关笔记

m0_58817196的博客 964

【AWS】创建aws云服务器EC2实例

本文介绍了如何创建aws的EC2云服务器,并介绍了如何使用Xshell远程连接上云服务器

Marcos921的博客 2511

使用JBuilder来制作EXE文件(白云原创)

倘若说看到标题后,以为jb真的提供了一种把java应用程序打包成exe文件的主流方法的话 , 你会失望的,下面的一个小技巧只是一个技巧而已。   使用JBuilder来制作可执行文件 ---白云黄鹤 jack 这个是Borland不公开的使用技巧,能够通过JBuilder来制作exe文件来启动Java文件。JBui lder并不支持本地编译机制。但是有一个隐藏的技巧可以让你从可执行文件来启动Jav

xxcc的专栏 8947

i.MX6ULL系统移植 | 使用busybox制作根文件系统(1.29.0)

一. 下载BusyBox BusyBox是一个继承了大量Linux命令核工具的软件,像常用的ls、cp、mv、ifconfig等命令。一般下载BusyBox的源码,然后配置Busybox,选择自己想要的功能,最后编译即可。 BusyBox在官方可以直接下载:https://www.busybox.net/。目前最新是1.35.0,这里我使用1.29.0版本。 axel https://www.busybox.net/downloads/busybox-1.29.0.tar.bz2 下载之后解压: tar

Mculover666的博客(嵌入式) 1153

Session Facade with EJB && .net

Session FacadeProvides a coarse grained facade on fine grained objects to improve efficiency over a network. In an object-oriented model, you do best with small objects that have small metho

xxcc的专栏 8886

网工、运维利器:MobaXterm,一款全能的远程工具

你好,这里是网络技术联盟站,我是瑞哥。是一款由Mobatek开发的多功能远程计算机管理工具,集成了多种网络协议和工具,专为网络工程师和系统管理员设计。它提供了丰富的远程连接功能,包括SSH、RDP、VNC、X11转发等,支持文件传输和多标签界面,内置了文本编辑器和多种网络工具,是一款全能的远程管理软件。MobaXterm的开发起始于2008年,最初只是一个简单的X服务器,但随着用户需求的不断增加和软件的逐步完善,MobaXterm逐渐发展成了一款功能全面、界面友好的远程管理工具。

网络技术联盟站 5244

YOLOv11 热力图可视化全流程:从模型解释到科研论证,让检测结果“有理可看”

无论是科研中需要严谨的模型解释,还是工业里要高效的缺陷定位,这套方法都能让你在“模型黑箱”与“业务需求”之间架起一座可视化的桥梁。别再让模型决策“无据可依”——现在就动手生成你的第一幅热力图,让 YOLOv11 的每一次检测都“有理可看”,用可视化的力量推动你的 AI 研究与落地走向深入!某团队在论文中通过热力图对比,证明其改进的注意力模块可使模型对小目标的关注区域更精准,实验论证说服力提升 50%;工业质检场景下,热力图帮助工程师快速定位模型漏检缺陷的原因——原来是对某类缺陷的特征关注不足。

m0_71589036的博客 689

EJB设计模式之Data Transfer Object

Data Transfer Object 在一个ejb系统中的客户端层需要一种向服务器往返 传输大块(bulk)数据的方法。 客户端怎样能和服务器交换大块数据而无需多个细粒 度网络调用呢? 在一个分布式应用中,客户端和服务器交互通常可能 有两个原因。第一个是从服务器上读取一些数据来显 示;第二个是通过创建,更新,删除数据来改变服务 器上的数据。在一个ejb环境,这些类型的操作通常 涉及和客户端(s

xxcc的专栏 4730

[deprecated]第九章:SVM机制: 9-2 Linux HMM原理与实现详解

Linux内核HMM(异构内存管理)子系统为异构计算平台提供统一内存管理机制,支持CPU与GPU等设备共享虚拟地址空间,实现零拷贝数据访问。其核心功能包括:1)统一虚拟地址空间,设备可直接访问CPU进程内存;2)实时页表同步与失效通知,确保地址空间一致性;3)支持设备端page fault处理;4)管理多种内存类型(系统内存、设备私有内存等)。HMM通过mmu_interval_notifier机制感知地址空间变化,提供标准API简化驱动开发,显著提升异构计算性能和数据传输效率。

图形/计算GPU的驱动与虚拟化技术分享园地 2588

最新EJB设计模式中文版之Session Facade(会话外观)

session facade一个EJB客户端为了完成一个用例需要执行一个商业逻辑。EJB客户端怎样才能在一个事务(transaction)和一个大批(bulk)网络调用中执行一个用例的商业逻辑呢?为了执行一个典型的用例的商业逻辑,多个服务器端对象(如session或entity bean)通常需要被存取和可能的修改。问题是session和entity bean的多个细粒度(fine-grain

xxcc的专栏 4293

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

java中的高速缓存和连接池对访问数据库性能的影响

一.初识高速缓存和连接池   设想这样一种情形:你突然口渴,需要一杯水来缓解,从心情上来讲,当然是越快越好 了。通常,一杯水的产生包括从水源(井水、河水或江水、甚至海水等)抽取,通过管 道传输和设备净化,才到达你饮水的容器中。上述过程是必须的,但并不是每一杯水的 产生都必须把上述过程重复一次。你可以用一个大一点的容器(例如缸或罐等)来盛大 量的水,喝水之前分到杯子小部分中即可,你的代价只是把水从缸

xxcc的专栏 2822

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

什么时候用有状态session bean,什么时候用无状态session bean

什么时候用有状态session bean,什么时候用无状态session bean最近,有关于无状态的许多大惊小怪。无状态的缺陷常常被夸大,它的优点也一样。许多无状态的支持者盲目的宣称无状态能带来更大的伸缩性;而有状态的支持者争论说必须为了适应无状态而重建整个系统。真实的情况是什么呢?通过正确地设计,无状态有以下两个优点:1.使用stateless bean,EJB容器能容易的poolin

xxcc的专栏 2254

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

EJB设计模式(第二版)之EJB Command

EJB Command 一个ejb客户端为了完成一个用例需要执行商业逻辑。 怎样让一个开发者用一个轻量级的态度实现一个用例的 商业逻辑,使客户端和ejb解耦并且用一个事务和一次 网络调用执行用例? 设计ejb系统时的一个重要的架构决定是把商业逻辑 放到什么地方?一个用例的商业逻辑是代表你的领域 模型中的合适的方法或跨多个其它entity bean 和/或 session bean执行逻辑(工作流逻

xxcc的专栏 2204

Message Driven Bean Proxy

Message Driven Beans consume messages from predefined JMS Topics or Queues. Applications that may need to utilize several Message Driven Beans to handle various messages are faced with a problem

xxcc的专栏 2168

EJB设计模式(第二版)之Message Facade

message facade 一个ejb客户端想要在一个环境的用例中调用多个ejb的 方法,并且不需要从服务器的立即的反映。 怎样才能让ejb客户端在一个事务中调用多个session bean或entity bean的方法,不需要被阻塞并且等待 每个bean的反映? 特别在大型系统中,伸缩性指明一个用例的商业逻辑 与客户端的分离执行,不需要客户端等待执行完毕。 这种类型的行为,叫做异步行为,允

xxcc的专栏 2091

SMTH Java FAQ (4) 2D作图以及文字处理

1 如何在2D Graphics中使用双缓冲?     首先你需要知道的是,如果你是在一个Swing组件上作图的画,Swing已经自动的为你   实现了双缓冲,因此没有必要在这个问题上上脑筋了。//感谢上帝     如果你使用的是AWT组件的话,你可以根据下面的流程使用双缓冲:         利用该组件之createImage()方法创建一个BufferedImage对象       利用Buf

xxcc的专栏 1699

Transient Entity

Transient Entity Posted By: Toby Hede on August 16, 2001 Anecdotal evidence suggests that many developers remain skeptical about the value of Entity Beans, especially prior to the

xxcc的专栏 1686

EJB2.0中什么时候用local interface,什么时候用remote interface

EJB2.0中什么时候用local interface,什么时候用remote interfacelocal interface是EJB2.0的新特性,它让你无需反复的网络通信就可以存取你的EJB组件。它也让你去传递非可序列化参数,非常顺手。因此remote interface的价值是什么?好,它实际上不是一个有价值的东东,除非:    1.你需要远程存取你的系统(就是说从一个远程web层),

xxcc的专栏 1682

Lazy Load with EJB

Lazy LoadAn object that doesnt contain all of the data you need, but knows how to get it. class Supplier... public List getProducts() { if (products == null) products = Product.findForS

xxcc的专栏 1654

EJB2.0系统中什么时候使用messaging或者RMI/IIOP

EJB2.0系统中什么时候使用messaging或者RMI/IIOP以下几条是messaging的优势,和你需要去使用它的原因:1.数据库性能。如果你去完成一个关系型数据库工作,如对一个数据库持久化一个定单,使用messaging更有优势。传送一个消息到一个二级消息队列去被晚些时候处理减轻了在高峰时刻的主数据库压力。在早上负荷较低的早上,当通信量比较小时,你能在消息队列中取出并处理那个消息,并

xxcc的专栏 1619

重构模式2

refactoring Patterns:第二部分 内容:简化测试更简单的设计Refactoring增进软件可理解性Refactoring 改进了软件的设计Refactoring 帮助你寻找BugRefactoring 让您

xxcc的专栏 1471

设置ODBC的自定义类CSetODBC

何志丹一,功能描述用于配置数据源用户名及密码.1,可以得到连接串,此串可用于CMyRecordset(派生于CRecordset)的GetDefaultConnect(),也可以用干CDataBase类OpenEx.2,如果用户配置正确,只需要配置一次,相关信息记录在文件.3,可以指定存储信息的文件名.因为有可能几个程序共用一个数据源.4,用户可以重新配置数据5,可以得到当前数据的类型.6

闻缺陷则喜何志丹 3214
上一篇: Observer Pattern - An Enterprise JavaBean Implementation
下一篇: Schema-oriented message destination
xxcc
博客等级 码龄26年 1粉丝 86原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址