针对SugarCRM活动SalesandMarketingBestPractices这个问题,本篇文章进行了详细的解答,同时本文还将给你拓展10bestpracticesinJava、AComplet
针对SugarCRM 活动 Sales and Marketing Best Practices这个问题,本篇文章进行了详细的解答,同时本文还将给你拓展10 best practices in Java、A Complete Guide to FreeNAS Hardware Design, Part I: Purpose and Best Practices、Aerospike 最佳实践 (Java Client Best Practices)、API 版本控制的最佳实践? [关闭] - Best practices for API versioning? [closed]等相关知识,希望可以帮助到你。
本文目录一览:- SugarCRM 活动 Sales and Marketing Best Practices
- 10 best practices in Java
- A Complete Guide to FreeNAS Hardware Design, Part I: Purpose and Best Practices
- Aerospike 最佳实践 (Java Client Best Practices)
- API 版本控制的最佳实践? [关闭] - Best practices for API versioning? [closed]
SugarCRM 活动 Sales and Marketing Best Practices
SugarCRM 活动 市场营销和销售的最佳实践
这一个小时免费的网络研讨会将讨论从销售和营销的角度,如何更好的使用 SugarCRM
时间:2014 年 6 月 5 日 10:00AM - 11:00AM . PST (北京时间 22:00 - 23:00)
地点:还是在网上啦
网址:http://www.osscube.com/webinar/register?webinarId=887233695&c=Sales%20and%20Marketing%20Best%20Practices&sd=2014-06-05&ed=2014-06-05
针对的对象:销售,市场营销
版本:SugarCRM 的 5.0 到 6.x
费用:免费
时长:1 小时
小提示:
了解一些 CRM 的技术,能帮助你最有效地使用 SugarCRM。
市场营销:
生成活动
跟踪销售线索成交率
确保跟进销售线索的提醒
自动分配规则
销售:
优化呼叫列表
销售漏斗管理
社区化营销
自定义标价功能
更多资讯请访问:
索孚方科官方网站 - SugarCRM 官方合作伙伴 http://www.srforce.cn
SugarCRM 中文官网网站 http://www.sugarcrmcn.cn/
10 best practices in Java
Source:10 best practices in Java | Medium
Oh, this author''s chart is really interesting.
This blog post will discuss some of the most common Java best practices, and explain why they are important. use your best judgement when deciding what is right for your codebase.
this blog will only present you the overall idea for each practice, but it will not go in depth, if you know to know more about any of these best practices…cough cough… Google is your friend!
Motto?
When you begin your career as a programmer, following a standard set of rules is likely appropriate. But as you progress, your skills become stronger, and you start to develop something which is lacking in the beginner — a sense of taste. This sense of taste, this wisdom which you’ve acquired through real experience, is what really guides a mature programmer. In essence, wisdom transcends rules.
1. Your Code Is Like A Story(More Important)
No matter how elegantly written, how efficient or how complex your code is, a piece of code is not going to make any sense unless it is well-organized and easy to follow.
- That’s why the best code tells a clear, concise story that can be easily understood by anyone who reads it
- In other words, your code should be like a good children’s book: each line should be expressive and contribute to the overall narrative.
- the best code is often creative and expressive
- If you can’t explain it simply, you don’t understand it well enough.
- But above all, it should be easy to read and understand
2. Use Design Patterns
Design patterns can save you a lot of time and effort when it comes to coding.
But that’s not all they’re good for. Design patterns can also make your code more readable and maintainable.
So if you’re not using design patterns, you should definitely consider doing so. They could just be the thing that takes your code to the next level.
I personally recommend that you focus on reading about the more popular and commonly used design patterns and understand the reasoning behind them.
3. Follow SOLID Principles
SOLID acronym stands for:
- Single Responsibility Principle (SRP)
- Open Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
Here is a website where you can get into details about them:
What are the SOLID principles in Java? (educative.io)
If you don''t have time to read, here are some simple code examples as a reference:
Single Responsibility Principle (SRP)
By applying SRP, we can separate the above class into three classes with separate responsibilities.
public class Vehicle {
public void printDetails() {}
public double calculateValue() {}
public void addVehicleToDB() {}
}
Open Closed Principle (OCP)
Please read the following code;
public double calculateValue(Vehicle v) {
if (v instanceof Car) {
return v.getValue() * 0.8;
if (v instanceof Bike) {
return v.getValue() * 0.5;
}
}
}
We would have to modify the above class by adding another if statement, which goes against the Open-Closed Principle.
So, we tried to remodel
public class Vehicle {
public double calculateValue() {...}
}
public class Car extends Vehicle {
public double calculateValue() {
return this.getValue() * 0.8;
}
}
public class Truck extends Vehicle {
public double calculateValue() {
return this.getValue() * 0.9;
}
}
Liskov Substitution Principle (LSP)
The Liskov Substitution Principle (LSP) applies to inheritance hierarchies such that derived classes must be completely substitutable for their base classes.
public class Rectangle {
private double height;
private double width;
public void setHeight(double h) { height = h; }
public void setWidht(double w) { width = w; }
...
}
public class Square extends Rectangle {
public void setHeight(double h) {
super.setHeight(h);
super.setWidth(h);
}
public void setWidth(double w) {
super.setHeight(w);
super.setWidth(w);
}
}
Interface segregation principle
The Interface Segregation Principle (ISP) states that clients should not be forced to depend upon interface members they do not use.
Here is a counter example
public interface Vehicle {
public void drive();
public void stop();
public void refuel();
public void openDoors();
}
public class Bike implements Vehicle {
// Can be implemented
public void drive() {...}
public void stop() {...}
public void refuel() {...}
// Can not be implemented
public void openDoors() {...}
}
The bike obviously shouldn''t have doors.
ISP proposes that the interfaces be broken down into multiple, small cohesive interfaces so that no class is forced to implement any interface, and therefore methods, that it does not need.
Dependency inversion principle
The Dependency Inversion Principle (DIP) states that we should depend on abstractions (interfaces and abstract classes) instead of concrete implementations (classes).
Instead of Car depending directly on Engine, let’s add an interface:
...
public interface Engine {
public void start();
}
...
public class Car {
private Engine engine;
public Car(Engine e) {
engine = e;
}
public void start() {
engine.start();
}
}
public class PetrolEngine implements Engine {
public void start() {...}
}
public class DieselEngine implements Engine {
public void start() {...}
}
4. DRY& KISS
- DRY = Don’t Repeat Yourself
- KISS = Keep It Simple Stupid
DRY:The DRY principle is stated as, “Every piece of knowledge or logic must have a single, unambiguous representation within a system.”.Divide your code and logic into smaller reusable units and use that code by calling it where you want.
Key Points:Don’t write lengthy methods.
KISS:Wherever possible, complexity should be avoided in a system. KISS is a design principle which states that designs and/or systems should be as simple as possible.
If you have a lot of conditions in the method, break these out into smaller methods. It will not only be easier to read and maintain, but it can help find bugs a lot faster.
Key Points:smaller methods.
5. Stop Hardcoding Stuff
First of all, it can make your code more difficult to read and understand.
Secondly, it can make your code less reusable.
Finally, it can lead to errors if the values you hardcode into your code happen to change (for example, if the current year changes).
if you ever need to use the same piece of code with different values, you’ll have to go in and manually change the hardcoded values
Hard coding is junk code, It’s usually better to use variables instead.
6. Comment Your Code
Comment Your Code or you have a one clear design, which of course is very difficult.
When you come back to a piece of code that you wrote six months ago, chances are you won’t remember what it does or how it works. But if you take the time to leave a clear and concise comment, you’ll save yourself a lot of headaches later on.
In addition, commenting your code makes it easier for others to understand and work with. So next time you’re programming, remember to take a few minutes to comment your code.
7. Declare Class Members Private Wherever Possible
Rule of thumb is to try to hide information as much as possible, sharing it only when absolutely necessary.
So, as to when you should make things private: I’d say make everything private by default, and then expose only those parts that have to be public. The more you can make private, the better.
8. Use StringBuilder/Buffer For String Manipulation
9. Learn To Check for Nulls
Generally, null variables, references and collections are tricky to handle in Java code. They are not only hard to identify but also complex to deal with.
There are many ways in which you can check for nulls and actually avoid or take care of them. There is a similar article in the previous personal study notes:
[[Checking for Nulls in Java Minimize Using If Else]]
Some of the methods she is mentioning are:
- java.util.Optional
- Utility classes of apache.commons
- Objects::nonNull in Streams
- requireNonNull methods of java.util.Objects
- Lombok’s Builder.Default
- NotNull, NotEmpty, NotBlank Annotations
10. Use Proper Naming Conventions
In java, it is good practice to name class, variables, and methods as what they are actually supposed to do instead of naming them randomly.
Java uses CamelCase as a practice for writing names of methods, variables, classes, packages, and constants.
These naming conventions must be followed while developing software in java for good maintenance and readability of code.
You can view the following article to understand more details of the name specification, the subsequent personal will also read this article and organize notes:
Finally
It’s important to realize that the coding techniques you learn should not be applied blindly, without thinking.
Rules are blind, in the sense that they often don’t deal with the full context of a problem, or the complete picture.
You shouldn’t be afraid to consider breaking the rules, if you have thought about the problem, and when you feel it’s an appropriate thing to do.
A Complete Guide to FreeNAS Hardware Design, Part I: Purpose and Best Practices
A guide to selecting and building FreeNAS hardware, written by the FreeNAS Team, is long past overdue by now. For that, we apologize. The issue was the depth and complexity of the subject, as you’ll see by the extensive nature of this four part guide, due to the variety of ways FreeNAS can be utilized. There is no “one-size-fits-all” hardware recipe. Instead, there is a wealth of hardware available, with various levels of compatibility with FreeNAS, and there are many things to take into account beyond the basic components, from use case and application to performance, reliability, redundancy, capacity, budget, need for support, etc. This document draws on years of experience with FreeNAS, ZFS, and the OS that lives underneath FreeNAS, FreeBSD. Its purpose is to give guidance on intelligently selecting hardware for use with the FreeNAS storage operating system, taking the complexity of its myriad uses into account, as well as providing some insight into both pathological and optimal configurations for ZFS and FreeNAS.
A word about software defined storage:
FreeNAS is an implementation of Software Defined Storage; although software and hardware are both required to create a functional system, they are decoupled from one another. We develop and provide the software and leave the hardware selection to the user. Implied in this model is the fact that there are a lot of moving pieces in a storage device (figuratively, not literally). Although these parts are all supposed to work together, the reality is that all parts have firmware, many devices require drivers, and the potential for there to be subtle (or gross) incompatibilities is always present.
Best Practices
ECC RAM or Not?
This is probably the most contested issue surrounding ZFS (the filesystem that FreeNAS uses to store your data) today. I’ve run ZFS with ECC RAM and I’ve run it without. I’ve been involved in the FreeNAS community for many years and have seen people argue that ECC is required and others argue that it is a pointless waste of money. ZFS does something no other filesystem you’ll have available to you does: it checksums your data, and it checksums the metadata used by ZFS, and it checksums the checksums. If your data is corrupted in memory before it is written, ZFS will happily write (and checksum) the corrupted data. Additionally, ZFS has no pre-mount consistency checker or tool that can repair filesystem damage. This is very nice when dealing with large storage arrays as a 64TB pool can be mounted in seconds, even after a bad shutdown. However if a non-ECC memory module goes haywire, it can cause irreparable damage to your ZFS pool that can cause complete loss of the storage. For this reason, I highly recommend the use of ECC RAM with “mission-critical” ZFS. Systems with ECC RAM will correct single bit errors on the fly, and will halt the system before they can do any damage to the array if multiple bit errors are detected. If it’s imperative that your ZFS based system must always be available, ECC RAM is a requirement. If it’s only some level of annoying (slightly, moderately…) that you need to restore your ZFS system from backups, non-ECC RAM will fit the bill.
How Much RAM is needed?
FreeNAS requires 8 GB of RAM for the base configuration. If you are using plugins and/or jails, 12 GB is a better starting point. There’s a lot of advice about how RAM hungry ZFS is, how it requires massive amounts of RAM, an oft quoted number is 1GB RAM per TB of storage. The reality is, it’s complicated. ZFS does require a base level of RAM to be stable, and the amount of RAM it needs to be stable does grow with the size of the storage. 8GB of RAM will get you through the 24TB range. Beyond that 16GB is a safer minimum, and once you get past 100TB of storage, 32GB is recommended. However, that’s just to satisfy the stability side of things. ZFS performance lives and dies by its caching. There are no good guidelines for how much cache a given storage size with a given number of simultaneous users will need. You can have a 2TB array with 3 users that needs 1GB of cache, and a 500TB array with 50 users that need 8GB of cache. Neither of those scenarios are likely, but they are possible. The optimal cache size for an array tends to increase with the size of the array, but outside of that guidance, the only thing we can recommend is to measure and observe as you go. FreeNAS includes tools in the GUI and the command line to see cache utilization. If your cache hit ratio is below 90%, you will see performance improvements by adding cache to the system in the form of RAM or SSD L2ARC (dedicated read cache devices in the pool).
RAID vs. Host Bus Adapters (HBAs)
ZFS wants direct control of the underlying storage that it is putting your data on. Nothing will make ZFS more unstable than something manipulating bits underneath ZFS. Therefore, connecting your drives to an HBA or directly to the ports on the motherboard is preferable to using a RAID controller; fortunately, HBAs are cheaper than RAID controllers to boot! If you must use a RAID controller, disable all write caching on it and disable all consistency checks. If the RAID controller has a passthrough or JBOD mode, use it. RAID controllers will complicate disk replacement and improperly configuring them can jeopardize the integrity of your volume (Using the write cache on a RAID controller is an almost sure-fire way to cause data loss with ZFS, to the tune of losing the entire pool).
Virtualization vs. Bare Metal
FreeBSD (the underlying OS of FreeNAS) is not the best virtualization guest: it lacks some virtio drivers, it lacks some OS features that make it a better behaved guest, and most importantly, it lacks full support from some virtualization vendors. In addition, ZFS wants direct access to your storage hardware. Many virtualization solutions only support hardware RAID locally (I’m looking at you, VMware) thus leading to enabling a worst case scenario of passing through a virtual disk on a datastore backed by a hardware RAID controller to a VM running FreeNAS. This puts two layers between ZFS and your data, one for the Host Virtualization’s filesystem on the datastore and another on the RAID controller. If you can do PCI passthrough of an HBA to a FreeNAS VM, and get all the moving pieces to work properly, you can successfully virtualize FreeNAS. We even include the guest VM tools in FreeNAS for VMware, mainly because we use VMware to do a lot of FreeNAS development. However if you have problems, there are no developer assets running FreeNAS as a production VM and help will be hard to come by. For this reason, I highly recommend that FreeNAS be run “On the Metal” as the only OS on dedicated hardware.
Josh Paetzel
iXsystems Director of IT
Part 2/4 of A Complete Guide to FreeNAS Hardware Design: Hardware Specifics >>
Aerospike 最佳实践 (Java Client Best Practices)
当使用Java API的塞式客户端遵循这些最佳实践。
同步的应用程序使用AerospikeClient ,异步的应用程序使用AsyncClient
同步操作,设置clientpolicy.maxthreads将生成最大的数量的客户端线程。maxthreads数量是连接各节点的连接池(默认值= 300)。如果设置连接池大小太低,则为每个数据库调用创建套接字,这是慢的。如果设置连接池太高,则保留太多空闲连接
异步操作,设置asyncclientpolicy.asyncmaxcommands的并发命令处理由客户端在任何时间点的最大数目。
订阅客户端日志记录设备接收重要的群集状态消息:
public class MyConsole implements Log.Callback {
public MyConsole() {
Log.setLevel(Log.Level.INFO);
Log.setCallback(this);
} @Override
public void log(Log.Level level, String message) { // Write log messages to the appropriate place.
}
}
每个aerospikeclient / asyncclient实例生成一个线程定期维护使信息请求的所有服务器节点分区映射。多个客户端实例在服务器上创建额外的负载。在应用程序中只使用一个客户实例,并在多个线程中共享实例。aerospikeclient和asyncclient是线程安全的。
默认情况下,用户定义的key不存储在服务器上。它被转换为用于识别记录的哈希摘要。如果用户定义的key必须保存在服务器,使用下列方法之一:
Set WritePolicy.sendKey to true — 该key被发送到服务器上并且存储,用于存储在多个记录扫描和查询中的写入。
明确地存储和检索一个bin中的用户定义键。
不要使用Value或者bin结构在一个对象中,这些构造函数比硬编码的构造函数慢,因为它的对象必须查询(using instanceof) 其真正的类型,还要使用Java默认的序列化,这是最慢的java序列化的实现,应该使用byte[]结构具有更好的序列效果。
使用AerospikeClient.operate()一次在相同的record批量执行多个operations (add/get) 。
在所有 record bins 创建或更新的情况下,在一个transaction中启用替换模式以提高性能。在更新前,服务器不需要读取旧记录。在更新bins的sub set子集的时候不能使用替换模式
WritePolicy policy = new WritePolicy();
policy.recordExistsAction = RecordExistsAction.REPLACE;
client.put(policy, key, bins);
每个数据库命令接受一个policy 作为第一个参数。如果policy 是相同的一组命令,再利用,而不是实例为每个命令他们的policy :
Set ClientPolicy defaults and pass in a null policy on each command
ClientPolicy policy = new ClientPolicy();
policy.readPolicyDefault.timeout = 50;
policy.readPolicyDefault.maxRetries = 1;
policy.readPolicyDefault.sleepBetweenRetries = 10;
policy.writePolicyDefault.timeout = 200;
policy.writePolicyDefault.maxRetries = 1;
policy.writePolicyDefault.sleepBetweenRetries = 50;
AerospikeClient client = new AerospikeClient(policy, "hostname", 3000);
client.put(null, new Key("test", "set", 1), new Bin("bin", 5));
Instantiate your own policies once and pass them to each database command:
public MyClass { private AerospikeClient client; private WritePolicy writePolicy; public MyClass(AerospikeClient client) {
this.client = client;
writePolicy = new WritePolicy();
writePolicy.timeout = 200;
writePolicy.maxRetries = 1;
writePolicy.sleepBetweenRetries = 50;
} public void put(Key key, Bin... bins) {
client.put(writePolicy, key, bins);
}
}
If a policy needs to change from the default (such as setting an expected generation), instantiated that policy on-the-fly:
public void putIfGeneration(Key key, int generation, Bin... bins) {
WritePolicy policy = new WritePolicy();
policy.generationPolicy = GenerationPolicy.EXPECT_GEN_EQUAL;
policy.generation = generation;
client.put(policy, key, bins);
}
API 版本控制的最佳实践? [关闭] - Best practices for API versioning? [closed]
问题:
Are there any known how-tos or best practices for web service REST API versioning? Web 服务 REST API 版本控制是否有任何已知的方法或最佳实践?
I have noticed that AWS does versioning by the URL of the endpoint . 我注意到 AWS 通过端点的 URL 进行版本控制 。 Is this the only way or are there other ways to accomplish the same goal? 这是唯一的方法还是有其他方法来实现同一目标? If there are multiple ways, what are the merits of each way? 如果有多种方式,每种方式的优点是什么?
解决方案:
参考一: https://stackoom.com/question/1dEv/API 版本控制的最佳实践 - 关闭参考二: https://oldbug.net/q/1dEv/Best-practices-for-API-versioning-closed
我们今天的关于SugarCRM 活动 Sales and Marketing Best Practices的分享就到这里,谢谢您的阅读,如果想了解更多关于10 best practices in Java、A Complete Guide to FreeNAS Hardware Design, Part I: Purpose and Best Practices、Aerospike 最佳实践 (Java Client Best Practices)、API 版本控制的最佳实践? [关闭] - Best practices for API versioning? [closed]的相关信息,可以在本站进行搜索。
本文标签: