Java社区进程(JCP)执行委员会的成员Ben Evans认为最急需重构的应用恰好就是最适合进行模块化的应用。如果你已经备受Lava Flow/God Class/Stovepipe System地狱的折磨,而且你的利益相关方明确知道这一点,那么你可能更容易说服他们进行一次完整的底层重构,通过渐进式的努力形成一个完成的模块解决方案(而不是简单重构并迁移至Java 8)是值得去做的。
对特定类型的应用来说,这是很有帮助的。例如,我曾经见到有的电子商务网站具有非常大的堆空间,其中包含了大约40G的字符串数据。Java 9的ompact Strings技术能够将这种类型的内存使用减半。这反过来又会对GC的性能带来积极的影响。对于有些应用来说(这可能就包括大型的Solr安装环境及类似场景),单单这一项收益就值得将运行时升级到Java 9。
这项变更是很重要的,因为相对于Parallel来说,G1会在应用线程上做更多的事情,而Parallel几乎没有在应用线程上做任何事情,它基本上完全依赖GC线程完成所有的内存管理。这意味着切换到G1将会为应用线程带来额外的工作,从而直接影响到应用的性能。 在很多(甚至可以说大多数)场景中,这种额外的性能损耗都不是什么问题。但是,在这方面,我确实也曾经见过从Parallel切换到G1时,有一定比例的工作负载会引起性能的下降。对于这些应用来说,这种性能下降是无法接受的,所以他们无法切换至G1收集器。随着G1成为默认的收集器,这将会影响到升级至Java 9的每个应用。
| C#: Smtp mailer = new Smtp(); mailer.AddAttachment(@"C:\My Documents\Report.xls"); |
| VB.NET: Dim mailer As New Smtp() mailer.AddAttachment("C:\My Documents\Report.xls") |
| C#: mailer.Message.Attachments.Add(@"C:\DataFiles\B4DVIS9H.TMP", "Annual report.doc"); |
| VB.NET: mailer.Message.Attachments.Add("C:\DataFiles\B4DVIS9H.TMP", "Annual report.doc") |
试用、下载、了解更多产品信息请点击"咨询在线客服"
using Leadtools; using Leadtools.Dicom; using Leadtools.Dicom.Scu.Common; using Leadtools.Dicom.Scu; using Leadtools.MedicalViewer; using System.Net; using System.IO;
// CStore highlevel 客户端和服务端对象
private StoreScu _cstore;
private DicomScp _server = new DicomScp();private void initServer() {
_server = new DicomScp();
_server.AETitle = "L19_PACS_SCP64";
_server.PeerAddress = IPAddress.Parse("10.32.1.75");
_server.Port = 534;
_server.Timeout = 30;
}private void initCstore() {
_cstore = new StoreScu();
_cstore.AETitle = "L19_CLIENT64";
_cstore.HostPort = 1030;
//存储成功后
_cstore.AfterCStore += _cstore_AfterCStore;
}private void 存储ToolStripMenuItem_Click(object sender, EventArgs e)
{
string filename ="D:\\Xa.dcm";
_cstore.Store(_server, filename);
}









C#
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
VB.NET
Dim pop As New Pop3()
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret")C#
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret", AuthenticationMethods.Apop);
VB.NET
Dim pop As New Pop3()
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret", AuthenticationMethods.Apop)C#
pop.Login("jdoe", "secret", AuthenticationMethods.Auto, AuthenticationOptions.PreferSimpleMethods, null);
VB.NET
pop.Login("jdoe", "secret", AuthenticationMethods.Auto, AuthenticationOptions.PreferSimpleMethods, Nothing)C# pop.Login(null, null, AuthenticationMethods.SaslNtlm); VB.NET pop.Login(Nothing, Nothing, AuthenticationMethods.SaslNtlm)
C#: MailBee.SmtpMail.Smtp.QuickSend("from@me.com", "to@you.com", "Subject", "Message Body"); |
VB.NET: MailBee.SmtpMail.Smtp.QuickSend("from@me.com", "to@you.com", "Subject", "Message Body") |
C#: MailBee.SmtpMail.Smtp.QuickSend("From Me (Company Info)", "To you ", "Subject", "Plain text body", "HTML-formatted body", null, @"C:\My Documents\report.doc"); |
VB.NET: MailBee.SmtpMail.Smtp.QuickSend("From Me (Company Info)", _ "To you ", _ "Subject", "Plain text body", _ "«html»HTML-formatted body«/html»", _ Nothing, "C:\My Documents\report.doc") |
C#: Smtp oMailer = new Smtp(); |
VB.NET: Dim oMailer As New Smtp() |
C#: oMailer.SmtpServers.Add("smtp.domain.com"); |
VB.NET: oMailer.SmtpServers.Add("smtp.domain.com") |
C#: oMailer.SmtpServers.Add("127.0.0.1"); |
VB.NET: oMailer.SmtpServers.Add("127.0.0.1") |
C#: oMailer.SmtpServers.Add("smtp.domain.com","login","password"); |
VB.NET: oMailer.SmtpServers.Add("smtp.domain.com","login","password") |
C#: oMailer.SmtpServers.Add("127.0.0.1","login","password"); |
VB.NET: oMailer.SmtpServers.Add("127.0.0.1","login","password") |
C#: oMailer.From.AsString = "Dan Brown (Company Info)"; |
VB.NET: oMailer.From.AsString = "Dan Brown (Company Info)" |
C#: oMailer.From.AsString = "Dan Brown "; |
VB.NET: oMailer.From.AsString = "Dan Brown " |
C#: oMailer.From.AsString = "dan@domain.com"; |
VB.NET: oMailer.From.AsString = "dan@domain.com" |
C#: oMailer.To.AsString = "Bill Smith (Remarks), Kathy@mail.com "; oMailer.Cc.AsString = "Joe Black , Joseph "; oMailer.Bcc.AsString = "t.jay@domain.com, s.connor@domain.com"; oMailer.ReplyTo.AsString = "john@domain.com, Barbara Jones "; |
VB.NET: oMailer.To.AsString = "Bill Smith (Remarks), Kathy@mail.com " oMailer.Cc.AsString = "Joe Black , Joseph " oMailer.Bcc.AsString = "t.jay@domain.com, s.connor@domain.com" oMailer.ReplyTo.AsString = "john@domain.com, Barbara Jones " |
C#: oMailer.Subject = "Test message"; |
VB.NET: oMailer.Subject = "Test message" |
C#: oMailer.BodyPlainText = "This is a test e-mail message."; |
VB.NET: oMailer.BodyPlainText = "This is a test e-mail message." |
C#: oMailer.BodyHtmlText = @" Test HTML message.
www.afterlogic.com"; |
VB.NET: oMailer.BodyHtmlText = " Test HTML message. " & vbCrLf & _ "" & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "www.afterlogic.com" |
C#: oMailer.AddAttachment(@"C:\annual_reoprt.xls"); oMailer.AddAttachment(@"C:\deposits.doc"); |
VB.NET: oMailer.AddAttachment("C:\annual_reoprt.xls") oMailer.AddAttachment("C:\deposits.doc") |
C#: try { oMailer.Send(); Console.WriteLine("The message has been successfully sent."); } catch (MailBeeSmtpRefusedRecipientException e) { Console.WriteLine("The following recipient was refused by SMTP server: " + e.RefusedRecipientEmail); } |
VB.NET: Try oMailer.Send() Console.WriteLine("The message has been successfully sent.") Catch e As MailBeeSmtpRefusedRecipientException Console.WriteLine("The following recipient was refused by SMTP server: " + e.RefusedRecipientEmail) End Try |
C#: using System; using MailBee; using MailBee.SmtpMail; namespace EmailApp { class Class1 { [STAThread] static void Main(string[] args) { Smtp oMailer = new Smtp(); oMailer.From.AsString = "John Doe (Company Info)"; oMailer.To.AsString = "Bill Smith , Kathy Ritchie (Company Info)"; oMailer.Subject = "Test e-mail"; oMailer.BodyPlainText = "This is a test e-mail message."; oMailer.BodyHtmlText = @" Test HTML message.
www.afterlogic.com"; oMailer.AddAttachment(@"C:\annual_reoprt.xls"); oMailer.SmtpServers.Add("127.0.0.1", "login", "password"); oMailer.SmtpServers[0].AllowRefusedRecipients = false; try { oMailer.Send(); Console.WriteLine("The message has been successfully sent."); } catch (MailBeeSmtpRefusedRecipientException e) { Console.WriteLine("The following recipient was refused by SMTP server: "+ e.RefusedRecipientEmail); } } } } |
VB.NET: Imports System Imports MailBee Imports MailBee.SmtpMail Namespace EmailApp Class Class1 _ Shared Sub Main(ByVal args() As String) Dim oMailer As New Smtp() oMailer.From.AsString = "John Doe (Company Info)" oMailer.To.AsString = "Bill Smith , Kathy Ritchie (Company Info)" oMailer.Subject = "Test e-mail" oMailer.BodyPlainText = "This is a test e-mail message." oMailer.BodyHtmlText = " Test HTML message. " & vbCrLf & _ "" & vbCrLf & _ " " & vbCrLf & _ " " & vbCrLf & _ "www.afterlogic.com" oMailer.AddAttachment("C:\annual_reoprt.xls") oMailer.SmtpServers.Add("127.0.0.1", "login", "password") oMailer.SmtpServers(0).AllowRefusedRecipients = False Try oMailer.Send() Console.WriteLine("The message has been successfully sent.") Catch e As MailBeeSmtpRefusedRecipientException Console.WriteLine("The following recipient was refused by SMTP server: "+ e.RefusedRecipientEmail) End Try End Sub End Class End Namespace |
