alibaba/BeeHive là dự án tập trung di động trên GitHub với 4.3k sao, viết chủ yếu bằng Objective-C. :honeybee: BeeHive is a solution for iOS Application module programs, it absorbed the Spring Framework API service concept to avoid coupling between modules.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
BeeHive is a modular program of implementation in iOS , it absorbed the Spring Framework API service concept to avoid to directly coupling between modules.
0.1 The basic architecture
We can get to know the architecture of BeeHive from this picture.
0.2 Core concepts
Module: Modules are separated by different function, every module can communicate with other one through their own services.
Service: Services are the interface of the specifically module.
0.3 Achieved characteristics
Plug-in module development of the operating framework
Module implementation and interface calls Separation
manage module life loop, extend the application of system events
0.4 Design
BeeHive bases on Spring Service concept, although you can make and implement specific interfaces decoupling between modules , but can not avoid interface class dependencies.
Why not use invoke and dynamic link library technology for decoupling interface , similar to Apache's DSO way?
Mainly on account of the difficulty and cost of learning to achieve , and dynamic invocation interface parameters can not be able to check phase change problems at compile time , dynamic programming techniques require a higher threshold requirement.
0.5 Project name origin
BeeHive inspired by the honeycomb. Honeycomb is the world's highly modular engineering structures, hexagonal design can bring unlimited expansion possibilities. So we used to do for this project BeeHive named.
1. Module life-cycle event
BeeHive's Each module will provide life-cycle events for the host environment and Each module necessary information exchange to BeeHive, you can observer the change in life run loop.
Events are divided into three types:
System Event
Universal Event
Business Custom Event
1.1 System Event
System events are usually Application life-cycle events , such as DidBecomeActive, WillEnterBackground etc.
System Event basic workflow is as follows:
1.2 Universal Event
On the basis of system events on the extended general application events , such modSetup, modInit , etc. , may be used to code each plug-in module initialization settings
Extended common events are as follows :
1.3 Business Custom Event
If you feel the system event , the event is not sufficient to meet the general needs , we will simplify the event packaged into BHAppdelgate, you can extend your own event by inheritance BHAppdelegate, while BHContext Lane modulesByName access each module entry class , to increase the trigger point through.
2. Module registration
Registration module divided into two types , static registration and dynamic registration
2.1 Static registration
2.2 Dynamic registration
Use BH_EXPORT_MODULE macro module entry in the class implementation declares the class for the
implementation class entry module
If the module is set to export BH_EXPORT_MODULE (YES), it will initialize asynchronous execution module can be optimized before starting after the first screen shows the contents of the start time consuming
3. Programming
BHModuleProtocol provides various modules each module can hook functions , and logic for implementing the plug-in code, you can fine protocol in BHModuleProtocol.h.
3.1 Setting environment variables
By context.env we can judge our application environment state to decide how we configure our application
-(void)modSetup:(BHContext *)context
{
switch (context.env) {
case BHEnvironmentDev:
break;
case BHEnvironmentProd:
default:
break;
}
}
3.2 Module Init
If the module there is need to start initialization logic can modInit in the preparation of , for example, the module can register an external module interface to access the Service
Event prepared by treating the various business modules can plug-in programming , it has no dependencies between the various business modules , through the interaction between the core and the event module, to achieve a plug-in isolation . But sometimes we need to call each other between modules some collaborative features to completion.
Usually in the form of three types to access service:
by interface(like Spring)
by Export Method(like PHP/ReactNative extension)
by URL Route pattern(like interaction between iPhone apps)
Interface type of service access can take the advantages of compile-time checking is found to change the interface , so that timely correction interface issues . The disadvantage is the need to rely on the interface definition header file by the module increases the more the maintenance interface definition there is a certain amount of work .
#import "BHService.h"
id< HomeServiceProtocol > homeVc = [[BeeHive shareInstance] createService:@protocol(HomeServiceProtocol)];
// use homeVc do invocation
3.5 Singleton or several instance
For some scenes , we visit each declared as service objects , objects can hope to retain some of the state , then we need to declare this service object is a singleton object .
We only need to implement the function declaration in the event service objects
-(BOOL) singleton
{
return YES;
}
The object was acquired by createService singleton object , if the function returns to achieve the above is NO, createService returns multiple cases
alibaba/BeeHive có 4.3k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/alibaba/BeeHive. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
alibaba/BeeHive có phải mã nguồn mở không?
Có — alibaba/BeeHive phát hành theo license GPL-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/alibaba/BeeHive.
alibaba/BeeHive còn đang phát triển không?
Commit gần nhất trên alibaba/BeeHive là 6.2 năm trước (theo timestamp GitHub). Repo có 776 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
alibaba/BeeHive dùng license gì?
alibaba/BeeHive phát hành theo license GPL-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
alibaba/BeeHive là gì?
alibaba/BeeHive (alibaba/BeeHive) là dự án Objective-C trên GitHub. Theo mô tả gốc: :honeybee: BeeHive is a solution for iOS Application module programs, it absorbed the Spring Framework API service concept to avoid coupling between modules.
alibaba/BeeHive viết bằng ngôn ngữ gì?
alibaba/BeeHive chủ yếu viết bằng Objective-C. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Cùng nhóm Mobile còn repo nào?
alibaba/BeeHive thuộc nhóm Mobile trên TopGit, cùng 11 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về alibaba/BeeHive ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/alibaba/BeeHive là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về BeeHive?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về BeeHive.